diff --git a/src/app/pages/jukebox/jukebox.component.html b/src/app/pages/jukebox/jukebox.component.html index 52690b1..dcfc51d 100644 --- a/src/app/pages/jukebox/jukebox.component.html +++ b/src/app/pages/jukebox/jukebox.component.html @@ -59,6 +59,16 @@ {{'jukebox' | i18n}} {{'jukebox.wait' | i18n}} + + + {{'jukebox.current' | i18n}} + {{currentTrack.name}} + + + {{artist.name}}, + + +

{{'jukebox.timeout' | i18n:timeout}}

diff --git a/src/app/pages/jukebox/jukebox.compontent.ts b/src/app/pages/jukebox/jukebox.compontent.ts index b36ca25..fa910c5 100644 --- a/src/app/pages/jukebox/jukebox.compontent.ts +++ b/src/app/pages/jukebox/jukebox.compontent.ts @@ -62,6 +62,11 @@ export class JukeboxComponent implements OnInit { } else if (error.status == 402) { this.wait = true; this.timeout = 60 - error.error; + + this.jukeboxService.current().subscribe((response) => { + this.currentTrack = response; + }); + this.timer = setInterval(() => { this.timeout--; if (this.timeout == 0) { diff --git a/src/app/services/jukebox.service.ts b/src/app/services/jukebox.service.ts index dc77b7c..9c263d0 100644 --- a/src/app/services/jukebox.service.ts +++ b/src/app/services/jukebox.service.ts @@ -22,6 +22,10 @@ export class JukeboxService { searchOffset(query: string, offset: number) { return this.http.get(environment.apiUrl + "/jukebox/search?q=" + query + "&offset=" + offset); } + + current() { + return this.http.get(environment.apiUrl + "/jukebox/current"); + } queue(uri: string) { return this.http.post(environment.apiUrl + "/jukebox/queue?uri=" + uri, "");