fix(statistics): cache Subsonic stat fetches and localize duration units

Add 7-minute TTL caches (same idea as rating prefetch) for overview
album strips, random-song format sample, and paginated library
aggregates; key by server and music folder.

Introduce formatHumanHoursMinutes with common.duration* strings in all
locales for Statistics and playlist duration labels.

Refresh RU/ZH statistics and nav wording; fix zh playtime label.
This commit is contained in:
Maxim Isaev
2026-04-10 01:39:08 +03:00
parent fc40d235d0
commit 6f6cb0fd6b
12 changed files with 233 additions and 90 deletions
+2 -4
View File
@@ -6,12 +6,10 @@ import { usePlayerStore, songToTrack } from '../store/playerStore';
import { usePlaylistStore } from '../store/playlistStore';
import CachedImage from '../components/CachedImage';
import { useTranslation } from 'react-i18next';
import { formatHumanHoursMinutes } from '../utils/formatHumanDuration';
function formatDuration(seconds: number): string {
const h = Math.floor(seconds / 3600);
const m = Math.floor((seconds % 3600) / 60);
if (h > 0) return `${h}h ${m}m`;
return `${m}m`;
return formatHumanHoursMinutes(seconds);
}
export default function Playlists() {