feat(settings): wire Playback + Scrobbling panels to the backend
Adds src/api/endpoints/settings.ts (getSettings/updateSettings, getScrobbling/updateScrobbling) plus AppSettings/ScrobblingConfig types and a Settings cache tag. Replaces the "coming soon" scaffolds: - Playback: stream-quality preference (SegmentedControl), server-synced. - Scrobbling: enable + provider (Last.fm/ListenBrainz) + username + write-only session key, with a linked/not-linked badge and save states. Built with modern-sk (Window/SegmentedControl/TextField/Button/Callout/ Badge) + the shared Loading/Error states; en + ru strings added. Server state flows through RTK Query hooks only (no fetch in components). Also drops a pre-existing unused TextField import in LibraryPage that was failing `tsc --noEmit`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -258,3 +258,24 @@ export interface MetadataEdit {
|
||||
genre?: string;
|
||||
trackNumber?: number;
|
||||
}
|
||||
|
||||
// -- user settings (`/settings`) ---------------------------------------------
|
||||
export type ThemePref = 'system' | 'light' | 'dark';
|
||||
export type StreamQuality = 'original' | 'high' | 'medium' | 'low';
|
||||
|
||||
/** General per-user preferences from `GET /settings`. */
|
||||
export interface AppSettings {
|
||||
theme: ThemePref;
|
||||
streamQuality: StreamQuality;
|
||||
}
|
||||
|
||||
export type ScrobbleProvider = 'lastfm' | 'listenbrainz';
|
||||
|
||||
/** Scrobbling config from `GET /settings/scrobbling`. The session key is
|
||||
* write-only server-side, so it never appears here — only `configured`. */
|
||||
export interface ScrobblingConfig {
|
||||
enabled: boolean;
|
||||
provider: ScrobbleProvider | null;
|
||||
username: string | null;
|
||||
configured: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user