fix: login flash, album name casing, lrclib duration mismatch
- Android: show nothing while DataStore loads credentials (null initial value) to prevent login screen flash on startup when already logged in - Web: dispAlbumName now only uses sortName as romaji for Japanese titles; English albums with lowercase ALBUMSORT tags now display correct casing - lrclib: add no-duration fallback exact match to find songs where local file duration differs from lrclib entry (e.g. Sanctuary Opening 5:58 vs 4:24) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
0272b9e99f
commit
f7012dab49
5 files changed
+34
-8
No files matched your search
@@ -174,7 +174,7 @@ async function _loadNpLyrics(songId) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 1. lrclib exact match — single request, only trust HTTP 200
|
||||
// 1a. lrclib exact match with duration
|
||||
const exactP = new URLSearchParams({ artist_name: artist, track_name: title });
|
||||
if(album) exactP.set('album_name', album);
|
||||
if(dur) exactP.set('duration', dur);
|
||||
@@ -187,6 +187,18 @@ async function _loadNpLyrics(songId) {
|
||||
}
|
||||
} catch {}
|
||||
|
||||
// 1b. exact match without duration — handles version mismatches (e.g. file at 5:58, lrclib has 4:24)
|
||||
if(!result && dur && album) {
|
||||
try {
|
||||
const exactNoDurP = new URLSearchParams({ artist_name: artist, track_name: title, album_name: album });
|
||||
const r = await fetch(`https://lrclib.net/api/get?${exactNoDurP}`, { signal: SIG() });
|
||||
if(r.status === 200) {
|
||||
const d = await r.json();
|
||||
if(d?.syncedLyrics || d?.plainLyrics || d?.instrumental) result = d;
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
if(token !== _lyricsLoadToken) return;
|
||||
|
||||
// 2+3. lrclib search — artist+title and title-only in parallel (2 requests, not 3)
|
||||
|
||||
Reference in new issue
Block a user