diff --git a/front/src/components/Queue.vue b/front/src/components/Queue.vue
index 723e98a5d..ec3d8768e 100644
--- a/front/src/components/Queue.vue
+++ b/front/src/components/Queue.vue
@@ -261,9 +261,9 @@ const coverType = useStorage('queue:cover-type', CoverType.COVER_ART)
>
{{ currentTrack.title }}
- {{ currentTrack.artistName }}
+ {{ currentTrack.artistName ?? $t('components.Queue.meta.unknownArtist') }}
- {{ currentTrack.albumTitle }}
+ {{ currentTrack.albumTitle ?? $t('components.Queue.meta.unknownAlbum') }}
@@ -282,7 +282,7 @@ const coverType = useStorage('queue:cover-type', CoverType.COVER_ART)
class="discrete link artist"
:to="{name: 'library.artists.detail', params: {id: currentTrack.artistId }}"
>
- {{ currentTrack.artistName }}
+ {{ currentTrack.artistName ?? $t('components.Queue.meta.unknownArtist') }}
@@ -290,7 +290,7 @@ const coverType = useStorage('queue:cover-type', CoverType.COVER_ART)
class="discrete link album"
:to="{name: 'library.albums.detail', params: {id: currentTrack.albumId }}"
>
- {{ currentTrack.albumTitle }}
+ {{ currentTrack.albumTitle ?? $t('components.Queue.meta.unknownAlbum') }}
diff --git a/front/src/components/audio/Player.vue b/front/src/components/audio/Player.vue
index c0a1e7c35..e7980f5ad 100644
--- a/front/src/components/audio/Player.vue
+++ b/front/src/components/audio/Player.vue
@@ -188,7 +188,7 @@ const hideArtist = () => {
:to="{name: 'library.artists.detail', params: {id: currentTrack.artistId }}"
@click.stop.prevent=""
>
- {{ currentTrack.artistName }}
+ {{ currentTrack.artistName ?? $t('components.audio.Player.meta.unknownArtist') }}
@@ -197,7 +197,7 @@ const hideArtist = () => {
:to="{name: 'library.albums.detail', params: {id: currentTrack.albumId }}"
@click.stop.prevent=""
>
- {{ currentTrack.albumTitle }}
+ {{ currentTrack.albumTitle ?? $t('components.audio.Player.meta.unknownAlbum') }}
@@ -216,10 +216,10 @@ const hideArtist = () => {
{{ currentTrack.title }}
- {{ currentTrack.artistName }}
+ {{ currentTrack.artistName ?? $t('components.audio.Player.meta.unknownArtist') }}
- {{ currentTrack.albumTitle }}
+ {{ currentTrack.albumTitle ?? $t('components.audio.Player.meta.unknownAlbum') }}
diff --git a/front/src/composables/audio/queue.ts b/front/src/composables/audio/queue.ts
index 9d05953e9..bea8df7e2 100644
--- a/front/src/composables/audio/queue.ts
+++ b/front/src/composables/audio/queue.ts
@@ -4,7 +4,6 @@ import { createGlobalState, useNow, useStorage, useTimeAgo, whenever } from '@vu
import { computed, ref, shallowReactive, watchEffect } from 'vue'
import { shuffle as shuffleArray, sum } from 'lodash-es'
import { useClamp } from '@vueuse/math'
-import { useI18n } from 'vue-i18n'
import { useStore } from '~/store'
import { looping, LoopingMode, isPlaying } from '~/composables/audio/player'
@@ -25,8 +24,8 @@ export interface QueueTrackSource {
export interface QueueTrack {
id: number
title: string
- artistName: string
- albumTitle: string
+ artistName?: string
+ albumTitle?: string
position?: number
// TODO: Add urls for those
@@ -99,9 +98,9 @@ export const currentTrack = computed(() => queue.value[currentIndex.value])
// Use Queue
export const useQueue = createGlobalState(() => {
const { currentSound } = useTracks()
+ // const { t } = useI18n()
const createQueueTrack = async (track: Track): Promise => {
- const { t } = useI18n()
const { default: store } = await import('~/store')
if (track.uploads.length === 0) {
@@ -115,8 +114,8 @@ export const useQueue = createGlobalState(() => {
return {
id: track.id,
title: track.title,
- artistName: track.artist?.name ?? t('composables.audio.queue.unknownArtist'),
- albumTitle: track.album?.title ?? t('composables.audio.queue.unknownAlbum'),
+ artistName: track.artist?.name,
+ albumTitle: track.album?.title,
position: track.position,
artistId: track.artist?.id ?? -1,
albumId: track.album?.id ?? -1,
diff --git a/front/src/locales/en_US.json b/front/src/locales/en_US.json
index 2f03a8814..1e93a77a0 100644
--- a/front/src/locales/en_US.json
+++ b/front/src/locales/en_US.json
@@ -190,7 +190,9 @@
},
"meta": {
"queuePosition": "Track {index} of {length}",
- "startTime": "00:00"
+ "startTime": "00:00",
+ "unknownArtist": "Unknown Artist",
+ "unknownAlbum": "Unknown Album"
}
},
"RemoteSearchForm": {
@@ -514,7 +516,9 @@
"player": "Audio player and controls"
},
"meta": {
- "position": "{index} of {length}"
+ "position": "{index} of {length}",
+ "unknownArtist": "Unknown Artist",
+ "unknownAlbum": "Unknown Album"
}
},
"Search": {
@@ -2960,10 +2964,6 @@
"audio": {
"usePlayOptions": {
"addToQueueMessage": "{n} tracks were added to your queue | {n} track was added to your queue | {n} tracks were added to your queue"
- },
- "queue": {
- "unknownArtist": "Unknown Artist",
- "unknownAlbum": "Unknown Album"
}
},
"locale": {