Merge pull request #662 from Nezreka/dev

fix(webui): recover artist detail deep links in legacy startup
This commit is contained in:
BoulderBadgeDad 2026-05-20 08:14:12 -07:00 committed by GitHub
commit afb0b65cb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View file

@ -2171,6 +2171,20 @@ function buildArtistDetailPath(artistId, source = null) {
return '/artist-detail/' + encodeURIComponent(normalizedSource) + '/' + encodeURIComponent(String(artistId));
}
function parseArtistDetailPath(pathname = window.location.pathname) {
const segs = String(pathname || '').split('/').filter(Boolean);
if (segs[0] !== 'artist-detail' || segs.length < 3) return null;
const source = decodeURIComponent(segs[1] || '');
const artistId = decodeURIComponent(segs.slice(2).join('/'));
if (!source || !artistId) return null;
return {
artistId,
source: source.toLowerCase() === 'library' ? null : source,
};
}
// ===============================
// MOBILE NAVIGATION
// ===============================

View file

@ -1175,6 +1175,14 @@ async function loadInitialData() {
return;
}
if (targetPage === 'artist-detail') {
const artistRoute = typeof parseArtistDetailPath === 'function' ? parseArtistDetailPath() : null;
if (artistRoute && typeof navigateToArtistDetail === 'function') {
navigateToArtistDetail(artistRoute.artistId, '', artistRoute.source);
}
return;
}
// Always apply the target page to the legacy shell chrome.
const router = getWebRouter();
const route = router?.routeManifest?.find((entry) => entry.pageId === targetPage);