mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-04-21 00:12:05 +00:00
Fixed an issue where the downloader would crash
This commit is contained in:
parent
0d051ac94d
commit
3ae1269ac7
3 changed files with 6 additions and 4 deletions
|
|
@ -70,9 +70,11 @@ const downloaded = (kind: {
|
|||
service: 'crunchy',
|
||||
type: 's'|'srz'
|
||||
}, ID: string, episode: string[]) => {
|
||||
const data = loadData();
|
||||
if (!Object.prototype.hasOwnProperty.call(data, kind.service))
|
||||
let data = loadData();
|
||||
if (!Object.prototype.hasOwnProperty.call(data, kind.service)) {
|
||||
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);
|
||||
fs.writeFileSync(archiveFile, JSON.stringify(data, null, 4));
|
||||
};
|
||||
|
|
|
|||
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "multi-downloader-nx",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.3",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "multi-downloader-nx",
|
||||
"short_name": "aniDL",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.3",
|
||||
"description": "Download videos from Funimation or Crunchyroll via cli",
|
||||
"keywords": [
|
||||
"download",
|
||||
|
|
|
|||
Loading…
Reference in a new issue