Revert "Route source-artist clicks to standalone /artist-detail page"
This reverts commit 1c345e4eb5.
This commit is contained in:
parent
1a8071d6ec
commit
18146098a7
4 changed files with 69 additions and 12 deletions
|
|
@ -2385,8 +2385,16 @@ async function openWatchlistArtistDetailView(artistId, artistName) {
|
|||
source = spotify_artist_id ? 'spotify' : discogs_artist_id ? 'discogs' : deezer_artist_id ? 'deezer' : 'itunes';
|
||||
}
|
||||
if (discogId) {
|
||||
// Watchlist discogId is a metadata-source id (Spotify/Deezer/iTunes),
|
||||
// not a library PK — route through the Artists page inline view.
|
||||
closeWatchlistArtistDetailView();
|
||||
navigateToArtistDetail(discogId, artistName, source);
|
||||
navigateToPage('artists');
|
||||
setTimeout(() => {
|
||||
selectArtistForDetail(
|
||||
{ id: discogId, name: artistName, image_url: artist.image_url || '' },
|
||||
{ source: source }
|
||||
);
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -739,7 +739,14 @@ async function checkRecommendedWatchlistStatuses(artists) {
|
|||
|
||||
async function viewRecommendedArtistDiscography(artistId, artistName) {
|
||||
closeRecommendedArtistsModal();
|
||||
navigateToArtistDetail(artistId, artistName);
|
||||
|
||||
const artist = { id: artistId, name: artistName };
|
||||
|
||||
// Recommended artists come from the metadata source — route through the
|
||||
// Artists page's inline view so the source-provided id resolves correctly.
|
||||
navigateToPage('artists');
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
await selectArtistForDetail(artist);
|
||||
}
|
||||
|
||||
async function checkAllHeroWatchlistStatus() {
|
||||
|
|
@ -821,8 +828,21 @@ async function viewDiscoverHeroDiscography() {
|
|||
return;
|
||||
}
|
||||
|
||||
const artist = {
|
||||
id: artistId,
|
||||
name: artistName,
|
||||
image_url: discoverHeroArtists[discoverHeroIndex]?.image_url || '',
|
||||
genres: discoverHeroArtists[discoverHeroIndex]?.genres || [],
|
||||
popularity: discoverHeroArtists[discoverHeroIndex]?.popularity || 0
|
||||
};
|
||||
|
||||
console.log(`🎵 Navigating to artist detail for: ${artistName}`);
|
||||
navigateToArtistDetail(artistId, artistName);
|
||||
|
||||
// Hero artists are source-provided recommendations — route through the
|
||||
// Artists page's inline view so the source id resolves correctly.
|
||||
navigateToPage('artists');
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
await selectArtistForDetail(artist);
|
||||
}
|
||||
|
||||
function showDiscoverHeroEmpty() {
|
||||
|
|
@ -4613,9 +4633,9 @@ function _renderYourArtistCard(artist) {
|
|||
const watchlistClass = artist.on_watchlist ? 'active' : '';
|
||||
const hasId = artist.active_source_id && artist.active_source_id !== '';
|
||||
|
||||
// Navigate to standalone artist detail page (name click)
|
||||
// Navigate to Artists page (name click) — source artist id, needs inline view
|
||||
const navAction = hasId
|
||||
? `event.stopPropagation(); navigateToArtistDetail('${escapeForInlineJs(artist.active_source_id)}', '${escapeForInlineJs(artist.artist_name)}')`
|
||||
? `event.stopPropagation(); navigateToPage('artists'); setTimeout(() => selectArtistForDetail({id:'${escapeForInlineJs(artist.active_source_id)}', name:'${escapeForInlineJs(artist.artist_name)}', image_url:'${escapeForInlineJs(img)}'}), 200)`
|
||||
: '';
|
||||
|
||||
// Open info modal (card body click) — pass pool ID so we can look up all data
|
||||
|
|
@ -4794,7 +4814,7 @@ async function openYourArtistInfoModal(poolId) {
|
|||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
|
||||
<span>Explore</span>
|
||||
</button>
|
||||
<button class="ya-header-btn ya-viewall-btn" onclick="document.getElementById('ya-info-modal-overlay')?.remove(); document.getElementById('your-artists-modal-overlay')?.remove(); navigateToArtistDetail('${escapeForInlineJs(artistId)}', '${escapeForInlineJs(artistName)}', '${escapeForInlineJs(pool.active_source || '')}' || null)">
|
||||
<button class="ya-header-btn ya-viewall-btn" onclick="document.getElementById('ya-info-modal-overlay')?.remove(); document.getElementById('your-artists-modal-overlay')?.remove(); navigateToPage('artists'); setTimeout(() => selectArtistForDetail({id:'${escapeForInlineJs(artistId)}', name:'${escapeForInlineJs(artistName)}', image_url:'${escapeForInlineJs(imageUrl)}'}, {source:'${escapeForInlineJs(pool.active_source || '')}'}), 200)">
|
||||
<span>View Discography</span>
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M5 12h14"/><path d="M12 5l7 7-7 7"/></svg>
|
||||
</button>
|
||||
|
|
@ -6694,7 +6714,7 @@ function _artMapSetupInteraction(canvas) {
|
|||
<div class="artmap-ctx-item" onclick="_artMapHideContextMenu(); ${hasId ? `openYourArtistInfoModal_direct(${JSON.stringify(node).replace(/"/g, '"')})` : ''}">
|
||||
<span>ⓘ</span> Artist Info
|
||||
</div>
|
||||
<div class="artmap-ctx-item" onclick="_artMapHideContextMenu(); navigateToArtistDetail('${escapeForInlineJs(bestId)}', '${escapeForInlineJs(node.name)}', '${bestSource}' || null)">
|
||||
<div class="artmap-ctx-item" onclick="_artMapHideContextMenu(); navigateToPage('artists'); setTimeout(() => selectArtistForDetail({id:'${escapeForInlineJs(bestId)}',name:'${escapeForInlineJs(node.name)}',image_url:'${escapeForInlineJs(node.image_url || '')}'},{source:'${bestSource}'}), 200)">
|
||||
<span>💿</span> View Discography
|
||||
</div>
|
||||
<div class="artmap-ctx-item" onclick="_artMapHideContextMenu(); toggleYourArtistWatchlist(0,'${escapeForInlineJs(node.name)}','${escapeForInlineJs(bestId)}','${bestSource}',null)">
|
||||
|
|
@ -7382,7 +7402,7 @@ async function openGenreDeepDive(genre) {
|
|||
// Always open on Artists page with discography — pass source for correct routing
|
||||
const imgUrl = _esc(a.image_url || '');
|
||||
const artSource = _esc(a.source || '');
|
||||
const clickAction = `onclick="document.getElementById('genre-deep-dive-modal').remove();navigateToArtistDetail('${_esc(a.entity_id)}','${_esc(a.name)}','${artSource}' || null)"`;
|
||||
const clickAction = `onclick="document.getElementById('genre-deep-dive-modal').remove();navigateToPage('artists');setTimeout(()=>selectArtistForDetail({id:'${_esc(a.entity_id)}',name:'${_esc(a.name)}',image_url:'${imgUrl}'},{source:'${artSource}'}),300)"`;
|
||||
const srcClass = (a.source || '').toLowerCase();
|
||||
return `<div class="genre-dive-artist" ${clickAction}>
|
||||
<div class="genre-dive-artist-img" style="${a.image_url ? `background-image:url('${_esc(a.image_url)}')` : ''}">
|
||||
|
|
|
|||
|
|
@ -634,7 +634,15 @@ function _navigateToArtistFromModal(artistId, artistName, imageUrl, source, play
|
|||
if (!artistName) return;
|
||||
// Close the download modal
|
||||
if (playlistId) closeDownloadMissingModal(playlistId);
|
||||
navigateToArtistDetail(artistId || artistName, artistName, source || null);
|
||||
// The id from a download modal is typically a metadata-source id; route via
|
||||
// the Artists page inline view so the source-aware discography endpoint runs.
|
||||
navigateToPage('artists');
|
||||
setTimeout(() => {
|
||||
selectArtistForDetail(
|
||||
{ id: artistId || artistName, name: artistName, image_url: imageUrl || '' },
|
||||
source ? { source: source } : undefined
|
||||
);
|
||||
}, 200);
|
||||
}
|
||||
|
||||
async function closeDownloadMissingModal(playlistId) {
|
||||
|
|
@ -5425,8 +5433,19 @@ function _gsSwitchSource(src) {
|
|||
|
||||
function _gsClickArtist(id, name, isLibrary) {
|
||||
_gsDeactivate();
|
||||
const source = isLibrary ? null : (_gsState.activeSource || null);
|
||||
navigateToArtistDetail(id, name, source);
|
||||
if (isLibrary) {
|
||||
// Library artists: id is a local DB PK — use the standalone artist-detail page.
|
||||
navigateToArtistDetail(id, name);
|
||||
} else {
|
||||
// Source artists: id is a Deezer/Spotify/iTunes id — route to the Artists
|
||||
// page's inline view which fetches discography from the source.
|
||||
navigateToPage('artists');
|
||||
setTimeout(() => {
|
||||
selectArtistForDetail({ id, name, image_url: '' }, {
|
||||
source: _gsState.activeSource || '',
|
||||
});
|
||||
}, 150);
|
||||
}
|
||||
}
|
||||
|
||||
async function _gsClickAlbum(albumId, albumName, artistName, imageUrl, source) {
|
||||
|
|
|
|||
|
|
@ -340,7 +340,17 @@ function initializeSearchModeToggle() {
|
|||
const sourceOverride = _activeSearchSource;
|
||||
console.log(`🎵 Opening artist detail: ${artist.name} (ID: ${artist.id}, source: ${sourceOverride})`);
|
||||
hideDropdown();
|
||||
navigateToArtistDetail(artist.id, artist.name, sourceOverride || null);
|
||||
|
||||
// Source artists are NOT library entries — their id is a Deezer/
|
||||
// Spotify/iTunes id, not a library PK. Route to the Artists page's
|
||||
// inline selectArtistForDetail which fetches discography from the
|
||||
// source directly, not the library's /api/artist-detail endpoint.
|
||||
navigateToPage('artists');
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
await selectArtistForDetail(artist, {
|
||||
source: sourceOverride,
|
||||
plugin: artist.external_urls?.hydrabase_plugin,
|
||||
});
|
||||
}
|
||||
})
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue