fix: iTunes JP-first with US fallback; romaji filter in playlist/starred search
This commit is contained in:
1 parent
a9463917e3
commit
3837783225
3 files changed
+17
-9
No files matched your search
+7
-3
@@ -6,7 +6,7 @@ import { playQueue, dlSongLocal, playPreview, toggleStar, parseArtists } from '.
|
||||
import { showCtxMenu, openEditPlModal, openDlModal, closeSidebar, switchNavMode } from './ui.js';
|
||||
import { closeNowPlaying, closeNpMenu } from './nowplaying.js';
|
||||
import { makeCard, makeAlbumCard, makeSongItem, makeGlobalTrackItem, mkSection } from './components.js';
|
||||
import { fetchRomajiIndex, dispArtistById } from './api.js';
|
||||
import { fetchRomajiIndex, dispArtistById, romajiLookup } from './api.js';
|
||||
import { loadSpotifyImporter } from './spotify.js';
|
||||
import { loadSoundCloudImporter } from './soundcloud.js';
|
||||
|
||||
@@ -748,7 +748,9 @@ export function filterPlaylist(val) {
|
||||
document.querySelectorAll('#playlist-songs .song-item').forEach(item => {
|
||||
const title = (item.querySelector('.song-title')?.textContent || '').toLowerCase();
|
||||
const artist = (item.querySelector('.song-artist')?.textContent || '').toLowerCase();
|
||||
item.style.display = (!q || title.includes(q) || artist.includes(q)) ? '' : 'none';
|
||||
if (!q || title.includes(q) || artist.includes(q)) { item.style.display = ''; return; }
|
||||
const rm = romajiLookup(item.dataset.songId);
|
||||
item.style.display = ((rm?.titleRomaji||'').toLowerCase().includes(q) || (rm?.artistRomaji||'').toLowerCase().includes(q)) ? '' : 'none';
|
||||
});
|
||||
}
|
||||
|
||||
@@ -916,7 +918,9 @@ export function filterStarred(val) {
|
||||
document.querySelectorAll('#starred-songs .song-item').forEach(item => {
|
||||
const title = (item.querySelector('.song-title')?.textContent || '').toLowerCase();
|
||||
const artist = (item.querySelector('.song-artist')?.textContent || '').toLowerCase();
|
||||
item.style.display = (!q || title.includes(q) || artist.includes(q)) ? '' : 'none';
|
||||
if (!q || title.includes(q) || artist.includes(q)) { item.style.display = ''; return; }
|
||||
const rm = romajiLookup(item.dataset.songId);
|
||||
item.style.display = ((rm?.titleRomaji||'').toLowerCase().includes(q) || (rm?.artistRomaji||'').toLowerCase().includes(q)) ? '' : 'none';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user