fix: handle empty xtream categories gracefully

Skip database insert when categories array is empty to prevent
'values() must be called with at least one value' error.

Closes #684
This commit is contained in:
4gray committed 2026-01-06 21:41:18 +01:00
1 parent 2043b7d8a1
commit bc30acf4a7
1 file changed
+5
@@ -75,6 +75,11 @@ ipcMain.handle(
type: 'live' | 'movies' | 'series'
) => {
try {
// Skip if no categories to save
if (!categories || categories.length === 0) {
return { success: true };
}
const db = await getDatabase();
const values = categories.map((cat) => ({
playlistId,