mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 23:05:46 +00:00
6f6cb0fd6b
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.
12 lines
437 B
TypeScript
12 lines
437 B
TypeScript
import i18n from '../i18n';
|
|
|
|
/** Totals / statistics: localized "N hours M minutes" (not track mm:ss). */
|
|
export function formatHumanHoursMinutes(seconds: number): string {
|
|
const h = Math.floor(seconds / 3600);
|
|
const m = Math.floor((seconds % 3600) / 60);
|
|
if (h > 0) {
|
|
return i18n.t('common.durationHoursMinutes', { hours: h.toLocaleString(), minutes: m });
|
|
}
|
|
return i18n.t('common.durationMinutesOnly', { minutes: m });
|
|
}
|