mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 09:01:03 -08:00
feat(types): enhance ElectronDbOperationEvent interface and add optional operationId to relevant database methods
This commit is contained in:
1 parent
34eca1d495
commit
c62ee4ae45
4 files changed
+50
-6
No files matched your search
Vendored
+35
-5
@@ -9,6 +9,18 @@ declare module 'video.js' {
|
|||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
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 {
|
interface Window {
|
||||||
electron: {
|
electron: {
|
||||||
getAppVersion: () => Promise<string>;
|
getAppVersion: () => Promise<string>;
|
||||||
@@ -118,9 +130,13 @@ declare global {
|
|||||||
updates: any
|
updates: any
|
||||||
) => Promise<{ success: boolean }>;
|
) => Promise<{ success: boolean }>;
|
||||||
dbDeletePlaylist: (
|
dbDeletePlaylist: (
|
||||||
playlistId: string
|
playlistId: string,
|
||||||
|
operationId?: string
|
||||||
) => Promise<{ success: boolean }>;
|
) => Promise<{ success: boolean }>;
|
||||||
dbDeleteXtreamContent: (playlistId: string) => Promise<{
|
dbDeleteXtreamContent: (
|
||||||
|
playlistId: string,
|
||||||
|
operationId?: string
|
||||||
|
) => Promise<{
|
||||||
success: boolean;
|
success: boolean;
|
||||||
favoritedXtreamIds: number[];
|
favoritedXtreamIds: number[];
|
||||||
recentlyViewedXtreamIds: {
|
recentlyViewedXtreamIds: {
|
||||||
@@ -138,7 +154,8 @@ declare global {
|
|||||||
recentlyViewedXtreamIds: {
|
recentlyViewedXtreamIds: {
|
||||||
xtreamId: number;
|
xtreamId: number;
|
||||||
viewedAt: string;
|
viewedAt: string;
|
||||||
}[]
|
}[],
|
||||||
|
operationId?: string
|
||||||
) => Promise<{ success: boolean }>;
|
) => Promise<{ success: boolean }>;
|
||||||
dbHasCategories: (
|
dbHasCategories: (
|
||||||
playlistId: string,
|
playlistId: string,
|
||||||
@@ -170,7 +187,8 @@ declare global {
|
|||||||
dbSaveContent: (
|
dbSaveContent: (
|
||||||
playlistId: string,
|
playlistId: string,
|
||||||
streams: any[],
|
streams: any[],
|
||||||
type: string
|
type: string,
|
||||||
|
operationId?: string
|
||||||
) => Promise<{ success: boolean; count: number }>;
|
) => Promise<{ success: boolean; count: number }>;
|
||||||
dbSearchContent: (
|
dbSearchContent: (
|
||||||
playlistId: string,
|
playlistId: string,
|
||||||
@@ -183,6 +201,10 @@ declare global {
|
|||||||
types: string[],
|
types: string[],
|
||||||
excludeHidden?: boolean
|
excludeHidden?: boolean
|
||||||
) => Promise<any[]>;
|
) => Promise<any[]>;
|
||||||
|
dbGetGlobalRecentlyAdded: (
|
||||||
|
kind: 'all' | 'vod' | 'series',
|
||||||
|
limit?: number
|
||||||
|
) => Promise<any[]>;
|
||||||
dbGetRecentlyViewed: () => Promise<any[]>;
|
dbGetRecentlyViewed: () => Promise<any[]>;
|
||||||
dbClearRecentlyViewed: () => Promise<{ success: boolean }>;
|
dbClearRecentlyViewed: () => Promise<{ success: boolean }>;
|
||||||
// Favorites
|
// Favorites
|
||||||
@@ -275,7 +297,15 @@ declare global {
|
|||||||
callback: (count: number) => void
|
callback: (count: number) => void
|
||||||
) => void;
|
) => void;
|
||||||
removeDbSaveContentProgress: () => 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
|
// Playback positions
|
||||||
dbSavePlaybackPosition: (
|
dbSavePlaybackPosition: (
|
||||||
playlistId: string,
|
playlistId: string,
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
"!{projectRoot}/test-setup.[jt]s"
|
"!{projectRoot}/test-setup.[jt]s"
|
||||||
],
|
],
|
||||||
"sharedGlobals": [
|
"sharedGlobals": [
|
||||||
"{workspaceRoot}/.github/workflows/ci.yml",
|
|
||||||
"{workspaceRoot}/.github/workflows/ci.yml"
|
"{workspaceRoot}/.github/workflows/ci.yml"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -37,6 +37,12 @@
|
|||||||
"libs/playlist/shared/util/src/index.ts"
|
"libs/playlist/shared/util/src/index.ts"
|
||||||
],
|
],
|
||||||
"@iptvnator/ui/epg": ["libs/ui/epg/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/ui/playback": ["libs/ui/playback/src/index.ts"],
|
||||||
"@iptvnator/playlist/import/feature": [
|
"@iptvnator/playlist/import/feature": [
|
||||||
"libs/playlist/import/feature/src/index.ts"
|
"libs/playlist/import/feature/src/index.ts"
|
||||||
@@ -72,6 +78,12 @@
|
|||||||
"shared-portals": ["libs/ui/shared-portals/src/index.ts"],
|
"shared-portals": ["libs/ui/shared-portals/src/index.ts"],
|
||||||
"remote-control": ["libs/ui/remote-control/src/index.ts"],
|
"remote-control": ["libs/ui/remote-control/src/index.ts"],
|
||||||
"database": ["libs/shared/database/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": [
|
"workspace-dashboard-feature": [
|
||||||
"libs/workspace/dashboard/feature/src/index.ts"
|
"libs/workspace/dashboard/feature/src/index.ts"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": "./apps/web/tsconfig.spec.json"
|
||||||
|
}
|
||||||
Reference in new issue
Block a user