Merge pull request #662 from Nezreka/dev
fix(webui): recover artist detail deep links in legacy startup
This commit is contained in:
commit
afb0b65cb1
2 changed files with 22 additions and 0 deletions
|
|
@ -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
|
||||
// ===============================
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue