From c8d5e9c0282d0aa89c5fd461fe3a2e558ef858d8 Mon Sep 17 00:00:00 2001 From: Psychotoxical Date: Fri, 20 Mar 2026 18:53:12 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20TypeScript=20build=20errors=20in=20Setti?= =?UTF-8?q?ngs=20and=20Statistics=20(count=E2=86=92n,=20relativeTime=20t?= =?UTF-8?q?=20type)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- src/i18n.ts | 4 ++-- src/pages/Settings.tsx | 2 +- src/pages/Statistics.tsx | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/i18n.ts b/src/i18n.ts index 0a0f2c4b..1e448bd4 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -294,7 +294,7 @@ const enTranslation = { lfmDisconnect: 'Disconnect', lfmConnectDesc: 'Connect your Last.fm account to enable scrobbling and Now Playing updates directly from Psysonic — no Navidrome configuration required.', lfmOpenBrowser: 'A browser window will open. Authorise Psysonic on Last.fm, then click the button below.', - lfmScrobbles: '{{count}} scrobbles', + lfmScrobbles: '{{n}} scrobbles', lfmMemberSince: 'Member since {{year}}', scrobbleEnabled: 'Scrobbling enabled', scrobbleDesc: 'Send songs to Last.fm after 50% playtime', @@ -784,7 +784,7 @@ const deTranslation = { lfmDisconnect: 'Trennen', lfmConnectDesc: 'Verbinde deinen Last.fm Account, um Scrobbling und Now-Playing-Updates direkt aus Psysonic heraus zu aktivieren — keine Navidrome-Konfiguration erforderlich.', lfmOpenBrowser: 'Es öffnet sich ein Browserfenster. Autorisiere Psysonic auf Last.fm und klicke dann unten auf den Button.', - lfmScrobbles: '{{count}} Scrobbles', + lfmScrobbles: '{{n}} Scrobbles', lfmMemberSince: 'Dabei seit {{year}}', scrobbleEnabled: 'Scrobbling aktiviert', scrobbleDesc: 'Songs nach 50% Laufzeit an Last.fm senden', diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 11ff3277..1e2a943a 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -345,7 +345,7 @@ export default function Settings() {
@{auth.lastfmUsername}
{lfmUserInfo && (
- {t('settings.lfmScrobbles', { count: lfmUserInfo.playcount.toLocaleString() })} + {t('settings.lfmScrobbles', { n: lfmUserInfo.playcount.toLocaleString() })} {t('settings.lfmMemberSince', { year: new Date(lfmUserInfo.registeredAt * 1000).getFullYear() })}
)} diff --git a/src/pages/Statistics.tsx b/src/pages/Statistics.tsx index 49a52b1a..d7b60060 100644 --- a/src/pages/Statistics.tsx +++ b/src/pages/Statistics.tsx @@ -5,7 +5,8 @@ import { useTranslation } from 'react-i18next'; import { useAuthStore } from '../store/authStore'; import { lastfmIsConfigured, lastfmGetTopArtists, lastfmGetTopAlbums, lastfmGetTopTracks, lastfmGetRecentTracks, LastfmPeriod, LastfmTopArtist, LastfmTopAlbum, LastfmTopTrack, LastfmRecentTrack } from '../api/lastfm'; -function relativeTime(timestamp: number, t: (key: string, opts?: object) => string): string { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function relativeTime(timestamp: number, t: (key: string, opts?: any) => string): string { const diff = Math.floor(Date.now() / 1000) - timestamp; if (diff < 60) return t('statistics.lfmJustNow'); if (diff < 3600) return t('statistics.lfmMinutesAgo', { n: Math.floor(diff / 60) });