Optionally include client data during manga migration

This commit is contained in:
schroda
2026-03-07 03:07:40 +01:00
parent 57e05bf20d
commit 00d6350cee
17 changed files with 382 additions and 97 deletions

View File

@@ -172,10 +172,10 @@ export class Chapters {
return chapters.filter((chapter) => !Chapters.isRead(chapter));
}
static getMatchingChapterNumberChapters<Chapter extends ChapterNumberInfo>(
chaptersA: Chapter[],
chaptersB: Chapter[],
): [ChapterA: Chapter, ChapterB: Chapter][] {
static getMatchingChapterNumberChapters<ChapterA extends ChapterNumberInfo, ChapterB extends ChapterNumberInfo>(
chaptersA: ChapterA[],
chaptersB: ChapterB[],
): [ChapterA: ChapterA, ChapterB: ChapterB][] {
return chaptersA
.map((chapterA) => {
const matchingChapter = chaptersB.find((chapterB) => chapterA.chapterNumber === chapterB.chapterNumber);
@@ -186,7 +186,7 @@ export class Chapters {
return [chapterA, matchingChapter];
})
.filter((matchingChapters): matchingChapters is [Chapter, Chapter] => matchingChapters !== null);
.filter((matchingChapters): matchingChapters is [ChapterA, ChapterB] => matchingChapters !== null);
}
static async download(chapterIds: number[], disableConfirmation?: boolean): Promise<void> {