diff --git a/src/lib/components/QueuePanel.svelte b/src/lib/components/QueuePanel.svelte index 883c21413..eb6cf39d6 100644 --- a/src/lib/components/QueuePanel.svelte +++ b/src/lib/components/QueuePanel.svelte @@ -18,8 +18,10 @@ onClose: () => void; currentTrack?: QueueTrack; upcomingTracks: QueueTrack[]; - queueTotalTracks?: number; // Real total from backend (excluding current track) + queueTotalTracks?: number; // Total tracks in the entire queue + queueRemainingTracks?: number; // Remaining tracks after current (total - played - 1) historyTracks?: QueueTrack[]; + isRadioMode?: boolean; // Is radio/similar tracks mode active onPlayTrack?: (trackId: string) => void; onPlayHistoryTrack?: (trackId: string) => void; onClearQueue?: () => void; @@ -36,7 +38,9 @@ currentTrack, upcomingTracks, queueTotalTracks = 0, + queueRemainingTracks = 0, historyTracks = [], + isRadioMode = false, onPlayTrack, onPlayHistoryTrack, onClearQueue, @@ -67,6 +71,7 @@ // Display limit const DISPLAY_LIMIT = 20; let displayCount = $state(DISPLAY_LIMIT); + let historyDisplayCount = $state(DISPLAY_LIMIT); // Infinite play banner dismissal let infiniteBannerDismissed = $state(false); @@ -97,6 +102,7 @@ searchOpen = false; searchQuery = ''; displayCount = DISPLAY_LIMIT; + historyDisplayCount = DISPLAY_LIMIT; } }); @@ -280,7 +286,11 @@ {#if upcomingTracks.length > 0}
- {$t('player.upNext').toUpperCase()} ({displayedTracks} {$t('player.ofTotal')} {infinitePlayEnabled ? '∞' : queueTotalTracks}) + {#if infinitePlayEnabled || isRadioMode} + {$t('player.upNext').toUpperCase()} ({displayedTracks} {$t('player.ofTotal')} ∞) + {:else} + {$t('player.upNext').toUpperCase()} ({displayedTracks} {$t('player.ofTotal')} {queueTotalTracks}, {queueRemainingTracks} {$t('player.remaining')}) + {/if}
{#each filteredTracks as track, index} @@ -309,11 +319,6 @@ {track.duration}
{/each} - {#if hasMoreTracks} - - {/if} {#if searchQuery && filteredTracks.length === 0}
{$t('player.noTracksMatch', { values: { query: searchQuery } })}
{/if} @@ -333,7 +338,7 @@
{$t('player.recentlyPlayed').toUpperCase()}
{#if historyTracks.length > 0}
- {#each historyTracks.slice(0, DISPLAY_LIMIT) as track} + {#each historyTracks.slice(0, historyDisplayCount) as track}
handleHistoryTrackClick(track)} @@ -355,6 +360,11 @@ {/if}
{/each} + {#if historyTracks.length > historyDisplayCount} + + {/if}
{:else}
diff --git a/src/lib/i18n/locales/en.json b/src/lib/i18n/locales/en.json index 2a1751451..ae797d783 100644 --- a/src/lib/i18n/locales/en.json +++ b/src/lib/i18n/locales/en.json @@ -221,6 +221,7 @@ "queue": "Queue", "upNext": "Up Next", "ofTotal": "of", + "remaining": "left", "history": "History", "recentlyPlayed": "Recently Played", "noHistoryYet": "No tracks played yet", diff --git a/src/lib/i18n/locales/es.json b/src/lib/i18n/locales/es.json index f0bdf5e5a..213cecd17 100644 --- a/src/lib/i18n/locales/es.json +++ b/src/lib/i18n/locales/es.json @@ -221,6 +221,7 @@ "queue": "Cola", "upNext": "Siguiente", "ofTotal": "de", + "remaining": "restantes", "history": "Historial", "recentlyPlayed": "Reproducido Recientemente", "noHistoryYet": "Sin pistas reproducidas aún", diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index c042b86db..ecbf99722 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -2532,8 +2532,10 @@ onClose={closeQueue} currentTrack={currentQueueTrack ?? undefined} upcomingTracks={queue} - queueTotalTracks={queueRemainingTracks} + {queueTotalTracks} + {queueRemainingTracks} {historyTracks} + isRadioMode={getCurrentContext()?.type === 'radio'} onPlayTrack={handleQueueTrackPlay} onPlayHistoryTrack={handlePlayHistoryTrack} onClearQueue={handleClearQueue}