feat(xtream): Xtream playlist refresh workflow

a dedicated refresh button and workflow for Xtream in the
recent playlists UI. Show a refresh icon only when the playlist has a
serverUrl. For Xtream playlists, prompt the user with a confirmation
dialog, delete locally cached categories and streams, show a toast that
the refresh started, and navigate to the playlist to trigger re-import.
Keep existing refresh IPC logic for non-Xtream (M3U/local) playlists.

Also add English translations for the Xtream refresh tooltip and dialog
messages, and surface errors via snackbar on failure.

This enables safe re-importing of remote Xtream playlists while preserving
favorites and recent items.
This commit is contained in:
4gray committed 2025-10-18 21:55:48 +02:00
1 parent 0a934d2ac6
commit 461e2e2e7e
8 files changed
+160 -60

No files matched your search

@@ -92,18 +92,24 @@ export class DatabaseService {
*/
async updateXtreamPlaylistDetails(playlist: {
id: string;
title: string;
title?: string;
username?: string;
password?: string;
serverUrl?: string;
updateDate?: number;
}): Promise<boolean> {
try {
await window.electron.dbUpdatePlaylist(playlist.id, {
name: playlist.title,
username: playlist.username,
password: playlist.password,
serverUrl: playlist.serverUrl,
});
const updates: any = {};
if (playlist.title) updates.name = playlist.title;
if (playlist.username) updates.username = playlist.username;
if (playlist.password) updates.password = playlist.password;
if (playlist.serverUrl) updates.serverUrl = playlist.serverUrl;
if (playlist.updateDate !== undefined)
updates.lastUpdated = new Date(
playlist.updateDate
).toISOString();
await window.electron.dbUpdatePlaylist(playlist.id, updates);
return true;
} catch (error) {
console.error('Error updating playlist details:', error);
@@ -97,6 +97,9 @@ export class PlaylistsService {
...(updatedPlaylist.password !== null
? { password: updatedPlaylist.password }
: {}),
...(updatedPlaylist.updateDate !== undefined
? { updateDate: updatedPlaylist.updateDate }
: {}),
})
)
);