fixed player behavior after final queue track completes, added click to play from queue window

This commit is contained in:
2026-02-15 16:20:56 -05:00
parent 38f3abbd3e
commit 67cea5cfb0
18 changed files with 438 additions and 89 deletions
@@ -110,4 +110,8 @@ export class QueueController implements ReactiveController {
cycleRepeat(): void {
queueStore.cycleRepeat();
}
playAtIndex(index: number): void {
queueStore.playAtIndex(index);
}
}
+2 -2
View File
@@ -51,8 +51,8 @@ class PlayerStore {
this.update({ isPlaying: data.state === 'playing' });
});
EventsOn(Events.TrackChanged, (trackInfo: TrackInfo) => {
this.update({ currentTrack: trackInfo });
EventsOn(Events.TrackChanged, (trackInfo: TrackInfo | null) => {
this.update({ currentTrack: trackInfo ?? null });
});
EventsOn(Events.PlaybackFinished, () => {
+7 -1
View File
@@ -7,6 +7,8 @@ export interface QueueTrack {
audioFileId: number;
filePath: string;
position: number;
title: string;
artist: string;
}
export type RepeatMode = 'off' | 'all' | 'one';
@@ -24,7 +26,7 @@ type Subscriber = () => void;
class QueueStore {
private state: QueueState = {
tracks: [],
currentIndex: 0,
currentIndex: -1,
shuffleMode: false,
repeatMode: 'off',
sourcePlaylistId: 0,
@@ -107,6 +109,10 @@ class QueueStore {
EventsEmit(Events.RequestCycleRepeat);
}
playAtIndex(index: number): void {
EventsEmit(Events.RequestPlayQueueIndex, index);
}
// ===================================================================
// SUBSCRIPTION SYSTEM
// ===================================================================