feat: enhance electron API with playlist type and backdrop URL support for favorites and recent items

This commit is contained in:
4gray committed 2026-04-22 22:24:13 +02:00
1 parent d88979e666
commit 73de25db21
1 file changed
+45 -6
@@ -482,13 +482,34 @@ const electronApi = {
),
dbGetGlobalRecentlyAdded: (
kind: 'all' | 'vod' | 'series',
limit?: number
) => ipcRenderer.invoke('DB_GET_GLOBAL_RECENTLY_ADDED', kind, limit),
limit?: number,
playlistType?:
| 'xtream'
| 'stalker'
| 'm3u-file'
| 'm3u-text'
| 'm3u-url'
) =>
ipcRenderer.invoke(
'DB_GET_GLOBAL_RECENTLY_ADDED',
kind,
limit,
playlistType
),
dbGetRecentlyViewed: () => ipcRenderer.invoke('DB_GET_RECENTLY_VIEWED'),
dbClearRecentlyViewed: () => ipcRenderer.invoke('DB_CLEAR_RECENTLY_VIEWED'),
// Favorites
dbAddFavorite: (contentId: number, playlistId: string) =>
ipcRenderer.invoke('DB_ADD_FAVORITE', contentId, playlistId),
dbAddFavorite: (
contentId: number,
playlistId: string,
backdropUrl?: string
) =>
ipcRenderer.invoke(
'DB_ADD_FAVORITE',
contentId,
playlistId,
backdropUrl
),
dbRemoveFavorite: (contentId: number, playlistId: string) =>
ipcRenderer.invoke('DB_REMOVE_FAVORITE', contentId, playlistId),
dbIsFavorite: (contentId: number, playlistId: string) =>
@@ -504,8 +525,17 @@ const electronApi = {
// Recently viewed (playlist-specific)
dbGetRecentItems: (playlistId: string) =>
ipcRenderer.invoke('DB_GET_RECENT_ITEMS', playlistId),
dbAddRecentItem: (contentId: number, playlistId: string) =>
ipcRenderer.invoke('DB_ADD_RECENT_ITEM', contentId, playlistId),
dbAddRecentItem: (
contentId: number,
playlistId: string,
backdropUrl?: string
) =>
ipcRenderer.invoke(
'DB_ADD_RECENT_ITEM',
contentId,
playlistId,
backdropUrl
),
dbClearPlaylistRecentItems: (playlistId: string) =>
ipcRenderer.invoke('DB_CLEAR_PLAYLIST_RECENT_ITEMS', playlistId),
dbRemoveRecentItem: (contentId: number, playlistId: string) =>
@@ -521,6 +551,15 @@ const electronApi = {
playlistId,
contentType
),
dbSetContentBackdropIfMissing: (
contentId: number,
backdropUrl?: string
) =>
ipcRenderer.invoke(
'DB_SET_CONTENT_BACKDROP_IF_MISSING',
contentId,
backdropUrl
),
dbDeleteAllPlaylists: (operationId?: string) =>
ipcRenderer.invoke('DB_DELETE_ALL_PLAYLISTS', operationId),
dbCancelOperation: (operationId: string) =>