Skip to content

Commit

Permalink
Add UI changes for dont stop the music.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinSchenkel committed Oct 7, 2024
1 parent e070d84 commit 0c94397
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
10 changes: 10 additions & 0 deletions src/layouts/default/PlayerOSD/PlayerFullscreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,16 @@ const openQueueMenu = function (evt: Event) {
a.label.toUpperCase() > b.label?.toUpperCase() ? 1 : -1,
),
},
{
label: store.activePlayerQueue!.dont_stop_the_music_enabled
? 'dont_stop_the_music_enabled'
: 'dont_stop_the_music_disabled',
labelArgs: [],
action: () => {
api.queueCommandDontStopTheMusicToggle(store.activePlayerQueue!.queue_id);
},
icon: 'mdi-all-inclusive'
}
];
eventbus.emit('contextmenu', {
items: menuItems,
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,14 @@ export class MusicAssistantApi {
this.queueCommandRepeat(queueId, RepeatMode.OFF);
}
}
public queueCommandDontStopTheMusic(queueId: string, dont_stop_the_music_enabled: boolean) {
// Configure dont_stop_the_music setting on the the queue.
this.playerQueueCommand(queueId, 'dont_stop_the_music', { dont_stop_the_music_enabled });
}
public queueCommandDontStopTheMusicToggle(queueId: string) {
// Toggle dont_stop_the_music mode of a queue
this.queueCommandDontStopTheMusic(queueId, !this.queues[queueId].dont_stop_the_music_enabled);
}
public playerQueueCommand(
queue_id: string,
command: string,
Expand Down
1 change: 1 addition & 0 deletions src/plugins/api/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ export interface PlayerQueue {
available: boolean;
items: number;
shuffle_enabled: boolean;
dont_stop_the_music_enabled: boolean;
repeat_mode: RepeatMode;
current_index?: number;
index_in_buffer?: number;
Expand Down
4 changes: 3 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,5 +527,7 @@
"image_make_primary": "Make primary",
"update_metadata": "Update metadata",
"cancel": "Cancel",
"transfer_queue": "Transfer queue to another player"
"transfer_queue": "Transfer queue to another player",
"dont_stop_the_music_enabled": "Don't stop the music is enabled",
"dont_stop_the_music_disabled": "Don't stop the music is disabled"
}
4 changes: 3 additions & 1 deletion src/translations/en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,5 +527,7 @@
"image_make_primary": "Make primary",
"update_metadata": "Update metadata",
"cancel": "Cancel",
"transfer_queue": "Transfer queue to another player"
"transfer_queue": "Transfer queue to another player",
"dont_stop_the_music_enabled": "Don't stop the music is enabled",
"dont_stop_the_music_disabled": "Don't stop the music is disabled"
}
4 changes: 3 additions & 1 deletion src/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -483,5 +483,7 @@
"play_replace": "Nu afspelen (queue leegmaken)",
"played": "Gespeeld",
"background_task_added": "De actie wordt door de server op de achtergrond uitgevoerd en kan enige tijd in beslag nemen. Houd het serverlogboek in de gaten voor de voortgang",
"cancel": "Annuleren"
"cancel": "Annuleren",
"dont_stop_the_music_enabled": "Don't stop the music is ingeschakeld",
"dont_stop_the_music_disabled": "Don't stop the music is uitgeschakeld"
}

0 comments on commit 0c94397

Please sign in to comment.