fix: invalidate sort caches after metadata save, remove sort-debug logs

After saving sort tags via the metadata editor, invalidate _artistSortMap
and the apiCached getArtists entry so the updated Navidrome sortName values
are picked up on the next page visit without a hard refresh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-06-08 23:34:12 +02:00
1 parent 85f8d758a5
commit 59adee60d5
3 files changed
+4 -6

No files matched your search

+1 -3
View File
@@ -133,12 +133,10 @@ export async function ensureArtistSortMap() {
_artistSortFetch = apiCached('getArtists')
.then(r => {
const all = (r?.artists?.index || []).flatMap(i => i.artist || []);
console.log('[sort-debug] getArtists sample (first 3):', all.slice(0,3).map(a => ({ id: a.id, name: a.name, sortName: a.sortName })));
cacheArtistSortNames(all);
console.log('[sort-debug] _artistSortMap size:', _artistSortMap?.size);
_artistSortFetch = null;
})
.catch(e => { console.warn('[sort-debug] ensureArtistSortMap error:', e); _artistSortFetch = null; });
.catch(e => { console.warn('ensureArtistSortMap error:', e); _artistSortFetch = null; });
return _artistSortFetch;
}