From 38f7991a0c56e2ced795cb096da48a9fe9614732 Mon Sep 17 00:00:00 2001 From: Siroco Date: Mon, 14 Dec 2020 19:19:37 +0100 Subject: [PATCH] Fix Dec 2020 --- src/app/app-routing.module.ts | 5 +++-- src/app/client.service.ts | 11 +++++++---- src/app/slide/slide.component.scss | 2 +- src/app/slide/slide.component.ts | 7 ++++++- src/assets/playlist.json | 7 ++++++- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 8b90898..7308d9a 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -5,9 +5,10 @@ import { InitComponent} from './init/init.component'; const routes: Routes = [ + { path: '404', redirectTo:'/home'}, { path: ':name', component: SlideComponent }, - { path: '', redirectTo: '/home', pathMatch: 'full'} - // { path: '', component: InitComponent } + { path: '', redirectTo: '/home', pathMatch: 'full'}, + { path: '**', redirectTo: '/home' } ]; @NgModule({ diff --git a/src/app/client.service.ts b/src/app/client.service.ts index 77b14ae..cceba59 100644 --- a/src/app/client.service.ts +++ b/src/app/client.service.ts @@ -2,6 +2,8 @@ import { Injectable } from '@angular/core'; import { HttpClient,HttpResponse } from '@angular/common/http'; import { Observable } from 'rxjs'; import {environment} from '../environments/environment'; +import { ActivatedRoute, Router } from '@angular/router'; + @Injectable({ providedIn: 'root' @@ -10,7 +12,10 @@ export class ClientService { apiUrl:string - constructor(private http: HttpClient) { + constructor( + private http: HttpClient, + private router: Router +) { this.apiUrl = environment.uriAPI } @@ -23,9 +28,7 @@ export class ClientService { } getItem(name:string) : Observable { - return this.http.get( - this.apiUrl+'/items/'+name+'/index.json', {} - ) + return this.http.get(this.apiUrl+'/items/'+name+'/index.json', {}) } } diff --git a/src/app/slide/slide.component.scss b/src/app/slide/slide.component.scss index b573774..68041b1 100644 --- a/src/app/slide/slide.component.scss +++ b/src/app/slide/slide.component.scss @@ -34,7 +34,7 @@ div.element { } div.init-title { - text-align:center;font-size:8vw;font-size:calc(12px + 2vw);cursor:pointer;background:#fff;color:#000;padding-top:5px;font-family:'Frutiger'; + text-align:center;font-size:8vw;font-size:calc(12px + 2vw);cursor:pointer;background:transparent;color:#fff;padding-top:5px;font-family:'Frutiger'; } div.big-title { diff --git a/src/app/slide/slide.component.ts b/src/app/slide/slide.component.ts index b328c03..534a91b 100644 --- a/src/app/slide/slide.component.ts +++ b/src/app/slide/slide.component.ts @@ -64,7 +64,12 @@ export class SlideComponent implements OnInit { params => { if (params.name) { this.clientService.getItem(params.name).subscribe( - (r) => { this.slide = r.data;} + (r) => { + this.slide = r.data; + }, + (error) => { + this.router.navigate(['404']) + } ) } } diff --git a/src/assets/playlist.json b/src/assets/playlist.json index 5350ea9..4cecedc 100644 --- a/src/assets/playlist.json +++ b/src/assets/playlist.json @@ -2,6 +2,11 @@ {"title":"Traktorea", "url":"https://www.soinumapa.net/wp-content/uploads/2020/10/20201017_TRACTOR_ARANDO.mp3"}, {"title":"Kanpaiak", "url":"https://www.soinumapa.net/wp-content/uploads/2020/10/20201017_BEIRE_CAMPANAS_EDIT.mp3"}, {"title":"Erlezaintza", "url":"https://www.soinumapa.net/wp-content/uploads/2020/10/20200909_ABEJAS_COMER_APICULTOR_DIA_BEIRE_ARGUEDAS.mp3"}, - {"title":"Uxue Santutegia", "url":"https://www.soinumapa.net/wp-content/uploads/2020/10/20200912_INTERIOR_IGLESIA_PUERTA_UJUE_EDITED.mp3"} + {"title":"Uxue Santutegia", "url":"https://www.soinumapa.net/wp-content/uploads/2020/10/20200912_INTERIOR_IGLESIA_PUERTA_UJUE_EDITED.mp3"}, + {"title":"Artzaina", "url":"http://www.soinumapa.net/wp-content/uploads/2020/10/20201001_PASTOR_LLAMA_OVEJAS_BEIRE_EDITED.mp3"}, + {"title":"Kilkerrak", "url":"http://www.soinumapa.net/wp-content/uploads/2020/10/20200911_GRILLOS_BEIRE_NOCHE.mp3"}, + {"title":"Tren geltokian", "url":"http://www.soinumapa.net/wp-content/uploads/2020/10/20200911_TREN_ESPERANDO_BEIRE_DIA.mp3"}, + {"title":"Improvisaciones musicales - Violín", "url":"http://lrullo.audio-lab.org/files/2020/12/MUSICA_VIOLIN.mp3"}, + {"title":"Improvisaciones musicales - Acordeón", "url":"http://lrullo.audio-lab.org/files/2020/12/MUSICA_ACORDEON.mp3"} ] }