feat(navidrome): Instant Mix probe, ping identity, and AudioMuse UX

Parse type and serverVersion from Subsonic ping; persist per-server identity and
run a background Instant Mix probe (random songs + getSimilarSongs) for
Navidrome 0.60+. Hide the AudioMuse server toggle when the probe returns no
similar tracks; clear prefs when the server is no longer eligible.

Artist pages fall back to Last.fm similar artists when AudioMuse is enabled but
the server returns none. Instant Mix failures set a per-server issue flag with a
settings warning and toast. Settings description links the official plugin repo
via i18n Trans.
This commit is contained in:
Maxim Isaev
2026-04-10 13:02:46 +03:00
parent 36f3d42dbe
commit 4de577eede
15 changed files with 463 additions and 68 deletions
+15 -3
View File
@@ -1,6 +1,6 @@
import { useState, useEffect, useCallback, useRef } from 'react';
import { useAuthStore } from '../store/authStore';
import { pingWithCredentials } from '../api/subsonic';
import { pingWithCredentials, scheduleInstantMixProbeForServer } from '../api/subsonic';
export type ConnectionStatus = 'connected' | 'disconnected' | 'checking';
@@ -37,8 +37,20 @@ export function useConnectionStatus() {
return;
}
const ok = await pingWithCredentials(server.url, server.username, server.password);
setStatus(ok ? 'connected' : 'disconnected');
const ping = await pingWithCredentials(server.url, server.username, server.password);
if (ping.ok) {
const sid = useAuthStore.getState().activeServerId;
if (sid) {
const identity = {
type: ping.type,
serverVersion: ping.serverVersion,
openSubsonic: ping.openSubsonic,
};
useAuthStore.getState().setSubsonicServerIdentity(sid, identity);
scheduleInstantMixProbeForServer(sid, server.url, server.username, server.password, identity);
}
}
setStatus(ping.ok ? 'connected' : 'disconnected');
}, []);
const retry = useCallback(async () => {