mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-25 19:14:00 +00:00
Fix status message not updating the frontend during M3U refresh.
This commit is contained in:
parent
767c42a1fe
commit
0ec5ffff33
1 changed files with 13 additions and 3 deletions
|
|
@ -192,9 +192,10 @@ export const WebsocketProvider = ({ children }) => {
|
|||
// Update the playlist status whenever we receive a status update
|
||||
// Not just when progress is 100% or status is pending_setup
|
||||
if (parsedEvent.data.status && parsedEvent.data.account) {
|
||||
const playlist = playlists.find(
|
||||
(p) => p.id === parsedEvent.data.account
|
||||
);
|
||||
// Check if playlists is an object with IDs as keys or an array
|
||||
const playlist = Array.isArray(playlists)
|
||||
? playlists.find((p) => p.id === parsedEvent.data.account)
|
||||
: playlists[parsedEvent.data.account];
|
||||
|
||||
if (playlist) {
|
||||
// When we receive a "success" status with 100% progress, this is a completed refresh
|
||||
|
|
@ -212,9 +213,18 @@ export const WebsocketProvider = ({ children }) => {
|
|||
parsedEvent.data.progress === 100
|
||||
) {
|
||||
updateData.updated_at = new Date().toISOString();
|
||||
// Log successful completion for debugging
|
||||
console.log('M3U refresh completed successfully:', updateData);
|
||||
}
|
||||
|
||||
updatePlaylist(updateData);
|
||||
} else {
|
||||
// Log when playlist can't be found for debugging purposes
|
||||
console.warn(
|
||||
`Received update for unknown playlist ID: ${parsedEvent.data.account}`,
|
||||
Array.isArray(playlists) ? 'playlists is array' : 'playlists is object',
|
||||
Object.keys(playlists).length
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue