diff --git a/front/src/composables/audio/queue.ts b/front/src/composables/audio/queue.ts index c269c8274..a589847bf 100644 --- a/front/src/composables/audio/queue.ts +++ b/front/src/composables/audio/queue.ts @@ -31,6 +31,7 @@ export interface QueueTrack { title: string artistName: string albumTitle: string + position?: number // TODO: Add urls for those coverUrl: string @@ -109,10 +110,9 @@ export const useQueue = createGlobalState(() => { return { id: track.id, title: track.title, - // TODO (wvffle): i18n artistName: track.artist?.name ?? $pgettext('*/*/*', 'Unknown artist'), - // TODO (wvffle): i18n albumTitle: track.album?.title ?? $pgettext('*/*/*', 'Unknown album'), + position: track.position, artistId: track.artist?.id ?? -1, albumId: track.album?.id ?? -1, coverUrl: (track.cover?.urls ?? track.album?.cover?.urls ?? track.artist?.cover?.urls)?.original @@ -171,7 +171,7 @@ export const useQueue = createGlobalState(() => { if (currentIndex.value !== trackIndex) currentSound.value?.seekTo(0) const shouldRestart = forceRestartIfCurrent && currentIndex.value === trackIndex - const nextTrackIsTheSame = queue.value[trackIndex].id === currentTrack.value.id + const nextTrackIsTheSame = queue.value[trackIndex]?.id === currentTrack.value?.id if (shouldRestart || nextTrackIsTheSame) { currentSound.value?.seekTo(0) diff --git a/front/src/composables/audio/usePlayOptions.ts b/front/src/composables/audio/usePlayOptions.ts index 7632f8521..1be2442e5 100644 --- a/front/src/composables/audio/usePlayOptions.ts +++ b/front/src/composables/audio/usePlayOptions.ts @@ -176,8 +176,7 @@ export default (props: PlayOptionsProps) => { addMessage(tracksToPlay) } - const activateTrack = async (track: Track, index: number) => { - // TODO (wvffle): Check if position checking did not break anything + const activateTrack = async (track: Track) => { if (track.id === currentTrack.value?.id && track.position === currentTrack.value?.position) { isPlaying.value = true }