fix: TypeScript build errors in Settings and Statistics (count→n, relativeTime t type)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Psychotoxical
2026-03-20 18:53:12 +01:00
parent 2ba7845c79
commit c8d5e9c028
3 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -294,7 +294,7 @@ const enTranslation = {
lfmDisconnect: 'Disconnect', lfmDisconnect: 'Disconnect',
lfmConnectDesc: 'Connect your Last.fm account to enable scrobbling and Now Playing updates directly from Psysonic — no Navidrome configuration required.', 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.', 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}}', lfmMemberSince: 'Member since {{year}}',
scrobbleEnabled: 'Scrobbling enabled', scrobbleEnabled: 'Scrobbling enabled',
scrobbleDesc: 'Send songs to Last.fm after 50% playtime', scrobbleDesc: 'Send songs to Last.fm after 50% playtime',
@@ -784,7 +784,7 @@ const deTranslation = {
lfmDisconnect: 'Trennen', lfmDisconnect: 'Trennen',
lfmConnectDesc: 'Verbinde deinen Last.fm Account, um Scrobbling und Now-Playing-Updates direkt aus Psysonic heraus zu aktivieren — keine Navidrome-Konfiguration erforderlich.', 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.', 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}}', lfmMemberSince: 'Dabei seit {{year}}',
scrobbleEnabled: 'Scrobbling aktiviert', scrobbleEnabled: 'Scrobbling aktiviert',
scrobbleDesc: 'Songs nach 50% Laufzeit an Last.fm senden', scrobbleDesc: 'Songs nach 50% Laufzeit an Last.fm senden',
+1 -1
View File
@@ -345,7 +345,7 @@ export default function Settings() {
<div style={{ fontWeight: 600, fontSize: 14 }}>@{auth.lastfmUsername}</div> <div style={{ fontWeight: 600, fontSize: 14 }}>@{auth.lastfmUsername}</div>
{lfmUserInfo && ( {lfmUserInfo && (
<div style={{ fontSize: 12, color: 'var(--text-muted)', marginTop: 2, display: 'flex', gap: '0.75rem' }}> <div style={{ fontSize: 12, color: 'var(--text-muted)', marginTop: 2, display: 'flex', gap: '0.75rem' }}>
<span>{t('settings.lfmScrobbles', { count: lfmUserInfo.playcount.toLocaleString() })}</span> <span>{t('settings.lfmScrobbles', { n: lfmUserInfo.playcount.toLocaleString() })}</span>
<span>{t('settings.lfmMemberSince', { year: new Date(lfmUserInfo.registeredAt * 1000).getFullYear() })}</span> <span>{t('settings.lfmMemberSince', { year: new Date(lfmUserInfo.registeredAt * 1000).getFullYear() })}</span>
</div> </div>
)} )}
+2 -1
View File
@@ -5,7 +5,8 @@ import { useTranslation } from 'react-i18next';
import { useAuthStore } from '../store/authStore'; import { useAuthStore } from '../store/authStore';
import { lastfmIsConfigured, lastfmGetTopArtists, lastfmGetTopAlbums, lastfmGetTopTracks, lastfmGetRecentTracks, LastfmPeriod, LastfmTopArtist, LastfmTopAlbum, LastfmTopTrack, LastfmRecentTrack } from '../api/lastfm'; 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; const diff = Math.floor(Date.now() / 1000) - timestamp;
if (diff < 60) return t('statistics.lfmJustNow'); if (diff < 60) return t('statistics.lfmJustNow');
if (diff < 3600) return t('statistics.lfmMinutesAgo', { n: Math.floor(diff / 60) }); if (diff < 3600) return t('statistics.lfmMinutesAgo', { n: Math.floor(diff / 60) });