Skip to content

Commit

Permalink
No, it doesn't dedupe automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
milesoc committed Jun 18, 2024
1 parent d8c65af commit 39e0395
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/MangaDex/MangaDexParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export const parseMangaList = async (object: MangaItem[], source: any, thumbnail

export const parseChapterListToManga = async (chapters: ChapterItem[], alreadyFound: string[], source: any): Promise<PartialSourceManga[]> => {
const results: PartialSourceManga[] = []
// const discoveredManga: Set<string> = new Set<string>()
const discoveredManga: Set<string> = new Set<string>()

// for (const foundId of alreadyFound) {
// discoveredManga.add(foundId)
// }
for (const foundId of alreadyFound) {
discoveredManga.add(foundId)
}

for (const chapter of chapters) {
const mangaRelationship: Relationship = chapter.relationships.filter((x) => x.type == 'manga')[0] as Relationship
Expand All @@ -52,7 +52,7 @@ export const parseChapterListToManga = async (chapters: ChapterItem[], alreadyFo
const subtitle = `${mangaDetails.lastVolume ? `Vol. ${mangaDetails.lastVolume}` : ''} ${mangaDetails.lastChapter ? `Ch. ${mangaDetails.lastChapter}` : ''}`


// if (!discoveredManga.has(mangaId)) {
if (!discoveredManga.has(mangaId)) {
results.push(
App.createPartialSourceManga({
mangaId: mangaId,
Expand All @@ -61,8 +61,8 @@ export const parseChapterListToManga = async (chapters: ChapterItem[], alreadyFo
subtitle: subtitle
})
)
// discoveredManga.add(mangaId)
// }
discoveredManga.add(mangaId)
}
}

return results
Expand Down

0 comments on commit 39e0395

Please sign in to comment.