diff --git a/frontend/src/v2/components/Soundtrack/Panel.vue b/frontend/src/v2/components/Soundtrack/Panel.vue index e5df9ae2c..2495f2def 100644 --- a/frontend/src/v2/components/Soundtrack/Panel.vue +++ b/frontend/src/v2/components/Soundtrack/Panel.vue @@ -50,6 +50,8 @@ const props = defineProps<{ loading?: boolean; /** True while the next page is in flight, for the list's footer spinner. */ loadingMore?: boolean; + /** Size of the whole queue when `tracks` is only the loaded window. */ + totalTracks?: number; startShuffled?: boolean; /** Cover shown when the active track has no art of its own. */ fallbackArtUrl?: string; @@ -222,6 +224,12 @@ const totalDurationSeconds = computed(() => ), ); +const trackCount = computed(() => props.totalTracks ?? tracks.value.length); + +// Only the loaded window has durations, so the running time is withheld until +// the whole queue is in rather than reported as a total it is not. +const isFullyLoaded = computed(() => trackCount.value === tracks.value.length); + // Reloading the queue whenever the input list changes keeps "next" pointing at // what the panel is showing, without the host having to drive the store. watch( @@ -347,9 +355,7 @@ function seekValueText(v: number): string { {{ isPlaying ? t("rom.now-playing") : t("rom.paused") }} - {{ - t("rom.tracks-n", tracks.length, { named: { n: tracks.length } }) - }} + {{ t("rom.tracks-n", trackCount, { named: { n: trackCount } }) }}