mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-21 22:15:40 +00:00
feat(device-sync): overhaul Device Sync page
- New two-panel layout with live album search (search3, 300ms debounce) and 10 random albums when search is empty — replaces full paginated load - Pre-sync summary modal: shows files to add/delete, net change, available space; Proceed button disabled when space is insufficient - calculate_sync_payload now filters already-synced tracks (path exists on device) so add_bytes/add_count reflect the true delta - Space check accounts for pending deletions: addBytes > availableBytes + delBytes - Separate deviceSyncJobStore for ephemeral job progress state - Removable drive detection + auto-poll every 5 s via sysinfo - Desired-state diff: de-selecting a synced source stages it for deletion instead of silently removing it - Status badges (Synced / Pending / Deletion) with matching row highlights - Live-Search badge (⚡) and Zufallsalben section label (⇌) in album browser - Status summary row height aligned with search field (52 px) - i18n: all new keys added to all 8 locales (en/de/fr/nl/nb/zh/ru/es) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+11
-4
@@ -23,7 +23,7 @@ function getAuthParams(username: string, password: string) {
|
||||
return { u: username, t: token, s: salt, v: '1.16.1', c: `psysonic/${version}`, f: 'json' };
|
||||
}
|
||||
|
||||
function getClient() {
|
||||
export function getClient() {
|
||||
const { getBaseUrl, getActiveServer } = useAuthStore.getState();
|
||||
const server = getActiveServer();
|
||||
const baseUrl = getBaseUrl();
|
||||
@@ -741,11 +741,18 @@ export async function fetchStatisticsFormatSample(): Promise<StatisticsFormatSam
|
||||
}
|
||||
|
||||
export async function getArtists(): Promise<SubsonicArtist[]> {
|
||||
const data = await api<{ artists: { index: Array<{ artist: SubsonicArtist[] }> } }>('getArtists.view', {
|
||||
const data = await api<{ artists: { index: any } }>('getArtists.view', {
|
||||
...libraryFilterParams(),
|
||||
});
|
||||
const indices = data.artists?.index ?? [];
|
||||
return indices.flatMap(i => i.artist ?? []);
|
||||
const rawIdx = data.artists?.index;
|
||||
const indices = Array.isArray(rawIdx) ? rawIdx : (rawIdx ? [rawIdx] : []);
|
||||
const artists: SubsonicArtist[] = [];
|
||||
for (const idx of indices) {
|
||||
const rawArt = idx.artist;
|
||||
const arr = Array.isArray(rawArt) ? rawArt : (rawArt ? [rawArt] : []);
|
||||
artists.push(...arr);
|
||||
}
|
||||
return artists;
|
||||
}
|
||||
|
||||
export async function getArtist(id: string): Promise<{ artist: SubsonicArtist; albums: SubsonicAlbum[] }> {
|
||||
|
||||
Reference in New Issue
Block a user