From 28a32033c4b1b7e2b35125c3b97fe7d56ff2f2c0 Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 28 Mar 2023 21:04:10 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20playing=20attribute=20for=20t?= =?UTF-8?q?rack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/shared/Playlist.ts | 4 +++- src/models/shared/Track.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/models/shared/Playlist.ts b/src/models/shared/Playlist.ts index f96ebea..9ca749a 100644 --- a/src/models/shared/Playlist.ts +++ b/src/models/shared/Playlist.ts @@ -129,7 +129,9 @@ export class Playlist { this.activeTrackIndex = 0; } - this.eventEmitter.emit('internal.audio.announce', this.getActiveTrack()); + const activeTrack = this.getActiveTrack(); + activeTrack.playing = true; + this.eventEmitter.emit('internal.audio.announce', activeTrack); } private isActiveTrackOutOfSync(): boolean { diff --git a/src/models/shared/Track.ts b/src/models/shared/Track.ts index b93875f..1965890 100644 --- a/src/models/shared/Track.ts +++ b/src/models/shared/Track.ts @@ -27,6 +27,8 @@ export class Track { */ remoteImages?: RemoteImageResult; + playing: boolean; + constructor( id: string, name: string,