Tranga-Website/Website/modules/interfaces/IJob.tsx

28 lines
875 B
TypeScript
Raw Normal View History

2024-10-18 19:45:04 +02:00
import IMangaConnector from "./IMangaConnector";
import IProgressToken from "./IProgressToken";
import IChapter from "./IChapter";
2024-10-18 19:45:04 +02:00
export default interface IJob{
progressToken: IProgressToken;
recurring: boolean;
recurrenceTime: string;
lastExecution: Date;
nextExecution: Date;
id: string;
jobType: number;
2024-10-18 19:45:04 +02:00
parentJobId: string | null;
mangaConnector: IMangaConnector;
mangaInternalId: string | undefined; //only on DownloadNewChapters
translatedLanguage: string | undefined; //only on DownloadNewChapters
chapter: IChapter | undefined; //only on DownloadChapter
}
export function JobTypeFromNumber(n: number): string {
switch(n) {
case 0: return "Download Chapter";
case 1: return "Download New Chapters";
case 2: return "Update Metadata";
case 3: return "Monitor";
}
return "";
2024-10-18 19:45:04 +02:00
}