Skip to content

Commit

Permalink
Fixed duplicate episode entries in archive
Browse files Browse the repository at this point in the history
  • Loading branch information
AnimeDL committed Jul 16, 2023
1 parent dbf1640 commit a87c345
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion modules/module.downloadArchive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ const downloaded = (kind: {
addToArchive(kind, ID);
data = loadData(); // Load updated version
}
(kind.service == 'crunchy' ? data[kind.service][kind.type] : data[kind.service][kind.type]).find(a => a.id === ID)?.already.push(...episode);

const archivedata = (kind.service == 'crunchy' ? data[kind.service][kind.type] : data[kind.service][kind.type]);
const alreadyData = archivedata.find(a => a.id === ID)?.already;
for (const ep of episode) {
if (alreadyData?.includes(ep)) continue;
alreadyData?.push(ep);
}
fs.writeFileSync(archiveFile, JSON.stringify(data, null, 4));
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "multi-downloader-nx",
"short_name": "aniDL",
"version": "4.3.0b6",
"version": "4.3.0b7",
"description": "Downloader for Crunchyroll, Funimation, or Hidive via CLI or GUI",
"keywords": [
"download",
Expand Down

0 comments on commit a87c345

Please sign in to comment.