Fix discovery fix button not working for mirrored playlists
This commit is contained in:
parent
98746961aa
commit
18b2766b01
1 changed files with 8 additions and 1 deletions
|
|
@ -12562,6 +12562,8 @@ function openDiscoveryFixModal(platform, identifier, trackIndex) {
|
||||||
state = youtubePlaylistStates[identifier]; // Beatport uses YouTube state infrastructure
|
state = youtubePlaylistStates[identifier]; // Beatport uses YouTube state infrastructure
|
||||||
} else if (platform === 'listenbrainz') {
|
} else if (platform === 'listenbrainz') {
|
||||||
state = listenbrainzPlaylistStates[identifier]; // ListenBrainz has its own state
|
state = listenbrainzPlaylistStates[identifier]; // ListenBrainz has its own state
|
||||||
|
} else if (platform === 'mirrored') {
|
||||||
|
state = youtubePlaylistStates[identifier]; // Mirrored playlists use YouTube state infrastructure
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support both camelCase and snake_case for discovery results
|
// Support both camelCase and snake_case for discovery results
|
||||||
|
|
@ -12795,6 +12797,9 @@ async function selectDiscoveryFixTrack(track) {
|
||||||
backendIdentifier = identifier;
|
backendIdentifier = identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mirrored playlists route through the YouTube endpoint (which already handles mirrored_ prefixes)
|
||||||
|
const apiPlatform = platform === 'mirrored' ? 'youtube' : platform;
|
||||||
|
|
||||||
const requestBody = {
|
const requestBody = {
|
||||||
identifier: backendIdentifier,
|
identifier: backendIdentifier,
|
||||||
track_index: trackIndex,
|
track_index: trackIndex,
|
||||||
|
|
@ -12810,7 +12815,7 @@ async function selectDiscoveryFixTrack(track) {
|
||||||
console.log('📡 Request body:', requestBody);
|
console.log('📡 Request body:', requestBody);
|
||||||
console.log('📡 Backend identifier:', backendIdentifier);
|
console.log('📡 Backend identifier:', backendIdentifier);
|
||||||
|
|
||||||
const response = await fetch(`/api/${platform}/discovery/update_match`, {
|
const response = await fetch(`/api/${apiPlatform}/discovery/update_match`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify(requestBody)
|
body: JSON.stringify(requestBody)
|
||||||
|
|
@ -12843,6 +12848,8 @@ async function selectDiscoveryFixTrack(track) {
|
||||||
state = youtubePlaylistStates[identifier];
|
state = youtubePlaylistStates[identifier];
|
||||||
} else if (platform === 'listenbrainz') {
|
} else if (platform === 'listenbrainz') {
|
||||||
state = listenbrainzPlaylistStates[identifier];
|
state = listenbrainzPlaylistStates[identifier];
|
||||||
|
} else if (platform === 'mirrored') {
|
||||||
|
state = youtubePlaylistStates[identifier];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support both camelCase and snake_case
|
// Support both camelCase and snake_case
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue