Files
KiraTV---App-Linux/apps/electron-backend/src/app/events/database/xtream.events.ts
T
2026-05-03 23:43:09 +02:00

54 lines
1.4 KiB
TypeScript

/**
* Xtream-specific IPC event handlers
* Operations for refreshing and managing Xtream playlist data
*/
import { ipcMain } from 'electron';
import { requestWorkerWithEvents } from './worker-events.utils';
ipcMain.handle(
'DB_DELETE_XTREAM_CONTENT',
async (event, playlistId: string, operationId?: string) => {
try {
return await requestWorkerWithEvents(
event,
'DB_DELETE_XTREAM_CONTENT',
{
playlistId,
operationId,
}
);
} catch (error) {
console.error('Error handling DB_DELETE_XTREAM_CONTENT:', error);
throw error;
}
}
);
ipcMain.handle(
'DB_RESTORE_XTREAM_USER_DATA',
async (
event,
playlistId: string,
favorites: unknown[],
recentlyViewed: unknown[],
operationId?: string
) => {
try {
return await requestWorkerWithEvents(
event,
'DB_RESTORE_XTREAM_USER_DATA',
{
playlistId,
favorites,
recentlyViewed,
operationId,
}
);
} catch (error) {
console.error('Error handling DB_RESTORE_XTREAM_USER_DATA:', error);
throw error;
}
}
);