Adding a removing jobs.

Having a list of running and waiting jobs
This commit is contained in:
2025-03-14 00:41:07 +01:00
parent 84520d8e18
commit 1eef710efc
21 changed files with 224 additions and 92 deletions

View File

@ -0,0 +1,5 @@
import IJob from "./IJob";
export default interface DownloadAvailableChaptersJob extends IJob {
mangaId: string;
}

View File

@ -0,0 +1,5 @@
import IJob from "./IJob";
export default interface DownloadMangaCoverJob extends IJob {
mangaId: string;
}

View File

@ -0,0 +1,5 @@
import IJob from "./IJob";
export default interface DownloadSingleChapterJob extends IJob {
chapterId: string;
}

View File

@ -0,0 +1,28 @@
export default interface IJob{
jobId: string;
parentJobId: string;
dependsOnJobIds: string[];
jobType: JobType;
recurrenceMs: number;
lastExecution: Date;
nextExecution: Date;
state: JobState;
enabled: boolean;
}
export enum JobType {
DownloadSingleChapterJob = "DownloadSingleChapterJob",
DownloadAvailableChaptersJob = "DownloadAvailableChaptersJob",
UpdateMetaDataJob = "UpdateMetaDataJob",
MoveFileOrFolderJob = "MoveFileOrFolderJob",
DownloadMangaCoverJob = "DownloadMangaCoverJob",
RetrieveChaptersJob = "RetrieveChaptersJob",
UpdateFilesDownloadedJob = "UpdateFilesDownloadedJob"
}
export enum JobState {
Waiting = "Waiting",
Running = "Running",
Completed = "Completed",
Failed = "Failed"
}

View File

@ -0,0 +1,6 @@
import IJob from "./IJob";
export default interface MoveFileOrFolderJob extends IJob {
fromLocation: string;
toLocation: string;
}

View File

@ -0,0 +1,5 @@
import IJob from "./IJob";
export default interface RetrieveChaptersJob extends IJob {
mangaId: string;
}

View File

@ -0,0 +1,5 @@
import IJob from "./IJob";
export default interface UpdateFilesDownloadedJob extends IJob {
mangaId: string;
}

View File

@ -0,0 +1,5 @@
import IJob from "./IJob";
export default interface UpdateMetadataJob extends IJob {
mangaId: string;
}