feat: load actual file sort tags in edit modal + remove settings hints
- backend: new GET /api/song-sorttags reads TITLESORT/ARTISTSORT/ALBUMARTISTSORT/ ALBUMSORT directly from the file via ffprobe - ui.js: pre-fill sort fields from romaji index, then overwrite with real file tags from the backend (shows actual values even if manually set) - index.html: remove redundant hint texts in settings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
5dda1a7101
commit
255ea1969c
3 files changed
+48
-3
No files matched your search
@@ -356,12 +356,22 @@ export function toggleInfoEdit() {
|
||||
document.getElementById('ie-disc').value = s.discNumber || '';
|
||||
document.getElementById('ie-totaltracks').value = s.albumSongCount || '';
|
||||
|
||||
// Sort tags — pre-fill from romaji index when available
|
||||
// Sort tags — pre-fill from romaji index, then overwrite with actual file tags if backend available
|
||||
const _rm = romajiLookup(s.id);
|
||||
document.getElementById('ie-titlesort').value = _rm?.titleRomaji || '';
|
||||
document.getElementById('ie-artistsort').value = _rm?.artistRomaji || '';
|
||||
document.getElementById('ie-albumartistsort').value = _rm?.artistRomaji || '';
|
||||
document.getElementById('ie-albumsort').value = _rm?.albumRomaji || '';
|
||||
if (S.cfg.backendUrl && s.id) {
|
||||
const p = new URLSearchParams({ ndUrl: S.cfg.url, user: S.cfg.user, pass: S.cfg.pass, songId: s.id });
|
||||
fetch(`${S.cfg.backendUrl}/api/song-sorttags?${p}`).then(r => r.ok ? r.json() : null).then(t => {
|
||||
if (!t) return;
|
||||
if (t.titleSort) document.getElementById('ie-titlesort').value = t.titleSort;
|
||||
if (t.artistSort) document.getElementById('ie-artistsort').value = t.artistSort;
|
||||
if (t.albumArtistSort) document.getElementById('ie-albumartistsort').value = t.albumArtistSort;
|
||||
if (t.albumSort) document.getElementById('ie-albumsort').value = t.albumSort;
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
// Art preview — use existing cover
|
||||
const cv = coverUrl(s.coverArt, 200);
|
||||
|
||||
Reference in new issue
Block a user