mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-01-11 20:10:20 +00:00
fixed ADN (NC) episodes not working
This commit is contained in:
parent
a27daa2ec6
commit
7fbf1a956b
1 changed files with 12 additions and 1 deletions
13
adn.ts
13
adn.ts
|
|
@ -255,7 +255,8 @@ export default class AnimationDigitalNetwork implements ServiceClass {
|
|||
const showData = show.value.videos[0].show;
|
||||
console.info(`[S.${showData.id}] ${showData.title}`);
|
||||
const specials: ADNVideo[] = [];
|
||||
let episodeIndex = 0, specialIndex = 0;
|
||||
const ncs: ADNVideo[] = [];
|
||||
let episodeIndex = 0, specialIndex = 0, ncIndex = 0;
|
||||
for (const episode of show.value.videos) {
|
||||
episode.season = episode.season+'';
|
||||
const seasonNumberTitleParse = episode.season.match(/\d+/);
|
||||
|
|
@ -274,6 +275,11 @@ export default class AnimationDigitalNetwork implements ServiceClass {
|
|||
episode.shortNumber = 'S'+specialIndex;
|
||||
specials.push(episode);
|
||||
episodeIndex--;
|
||||
} else if (episode.number.includes('(NC)')) {
|
||||
ncIndex++;
|
||||
episode.shortNumber = 'NC'+ncIndex;
|
||||
ncs.push(episode);
|
||||
episodeIndex--;
|
||||
} else {
|
||||
console.info(` (${episode.id}) [E${episode.shortNumber}] ${episode.number} - ${episode.name}`);
|
||||
}
|
||||
|
|
@ -283,7 +289,12 @@ export default class AnimationDigitalNetwork implements ServiceClass {
|
|||
console.info(` (Special) (${special.id}) [${special.shortNumber}] ${special.number} - ${special.name}`);
|
||||
show.value.videos.splice(show.value.videos.findIndex(i => i.id === special.id), 1);
|
||||
}
|
||||
for (const nc of ncs) {
|
||||
console.info(` (NC) (${nc.id}) [${nc.shortNumber}] ${nc.number} - ${nc.name}`);
|
||||
show.value.videos.splice(show.value.videos.findIndex(i => i.id === nc.id), 1);
|
||||
}
|
||||
show.value.videos.push(...specials);
|
||||
show.value.videos.push(...ncs);
|
||||
return { isOk: true, value: show.value };
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue