From c62ee4ae4580372f49e5f96fe14b412b5f396a8a Mon Sep 17 00:00:00 2001 From: 4gray Date: Sat, 28 Mar 2026 15:43:15 +0100 Subject: [PATCH] feat(types): enhance ElectronDbOperationEvent interface and add optional operationId to relevant database methods --- global.d.ts | 40 +++++++++++++++++++++++++++++++++++----- nx.json | 1 - tsconfig.base.json | 12 ++++++++++++ tsconfig.spec.json | 3 +++ 4 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 tsconfig.spec.json diff --git a/global.d.ts b/global.d.ts index 80d1e55d4..4b89b4696 100644 --- a/global.d.ts +++ b/global.d.ts @@ -9,6 +9,18 @@ declare module 'video.js' { } declare global { + interface ElectronDbOperationEvent { + operationId?: string; + operation: string; + playlistId?: string; + status: 'started' | 'progress' | 'completed' | 'cancelled' | 'error'; + phase?: string; + current?: number; + total?: number; + increment?: number; + error?: string; + } + interface Window { electron: { getAppVersion: () => Promise; @@ -118,9 +130,13 @@ declare global { updates: any ) => Promise<{ success: boolean }>; dbDeletePlaylist: ( - playlistId: string + playlistId: string, + operationId?: string ) => Promise<{ success: boolean }>; - dbDeleteXtreamContent: (playlistId: string) => Promise<{ + dbDeleteXtreamContent: ( + playlistId: string, + operationId?: string + ) => Promise<{ success: boolean; favoritedXtreamIds: number[]; recentlyViewedXtreamIds: { @@ -138,7 +154,8 @@ declare global { recentlyViewedXtreamIds: { xtreamId: number; viewedAt: string; - }[] + }[], + operationId?: string ) => Promise<{ success: boolean }>; dbHasCategories: ( playlistId: string, @@ -170,7 +187,8 @@ declare global { dbSaveContent: ( playlistId: string, streams: any[], - type: string + type: string, + operationId?: string ) => Promise<{ success: boolean; count: number }>; dbSearchContent: ( playlistId: string, @@ -183,6 +201,10 @@ declare global { types: string[], excludeHidden?: boolean ) => Promise; + dbGetGlobalRecentlyAdded: ( + kind: 'all' | 'vod' | 'series', + limit?: number + ) => Promise; dbGetRecentlyViewed: () => Promise; dbClearRecentlyViewed: () => Promise<{ success: boolean }>; // Favorites @@ -275,7 +297,15 @@ declare global { callback: (count: number) => void ) => void; removeDbSaveContentProgress: () => void; - dbDeleteAllPlaylists: () => Promise<{ success: boolean }>; + onDbOperationEvent?: ( + callback: (data: ElectronDbOperationEvent) => void + ) => () => void; + dbDeleteAllPlaylists: ( + operationId?: string + ) => Promise<{ success: boolean }>; + dbCancelOperation: ( + operationId: string + ) => Promise<{ success: boolean }>; // Playback positions dbSavePlaybackPosition: ( playlistId: string, diff --git a/nx.json b/nx.json index fcd876627..52e500601 100644 --- a/nx.json +++ b/nx.json @@ -16,7 +16,6 @@ "!{projectRoot}/test-setup.[jt]s" ], "sharedGlobals": [ - "{workspaceRoot}/.github/workflows/ci.yml", "{workspaceRoot}/.github/workflows/ci.yml" ] }, diff --git a/tsconfig.base.json b/tsconfig.base.json index 25bbf5e42..3fc47b293 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -37,6 +37,12 @@ "libs/playlist/shared/util/src/index.ts" ], "@iptvnator/ui/epg": ["libs/ui/epg/src/index.ts"], + "@iptvnator/ui/epg/progress-panel": [ + "libs/ui/epg/src/lib/epg-progress-panel/epg-progress-panel.component.ts" + ], + "@iptvnator/ui/playback/external-player-info-dialog": [ + "libs/ui/playback/src/lib/external-player-info-dialog/external-player-info-dialog.component.ts" + ], "@iptvnator/ui/playback": ["libs/ui/playback/src/index.ts"], "@iptvnator/playlist/import/feature": [ "libs/playlist/import/feature/src/index.ts" @@ -72,6 +78,12 @@ "shared-portals": ["libs/ui/shared-portals/src/index.ts"], "remote-control": ["libs/ui/remote-control/src/index.ts"], "database": ["libs/shared/database/src/index.ts"], + "database-schema": [ + "libs/shared/database/src/lib/schema.ts" + ], + "database-path-utils": [ + "libs/shared/database/src/lib/path-utils.ts" + ], "workspace-dashboard-feature": [ "libs/workspace/dashboard/feature/src/index.ts" ], diff --git a/tsconfig.spec.json b/tsconfig.spec.json new file mode 100644 index 000000000..6e98bf10b --- /dev/null +++ b/tsconfig.spec.json @@ -0,0 +1,3 @@ +{ + "extends": "./apps/web/tsconfig.spec.json" +}