GitIgnore update + Fix: Parse Floats not int, so that we can deal with '.5' chapters

master
masterhc 1 year ago
parent f6feb3f322
commit f02f6bbfe1

3
.gitignore vendored

@ -1,2 +1,3 @@
node_modules
Saved
Saved
.vscode

@ -50,7 +50,7 @@ module.exports = class AsuraModule
title:result.rawAttrs.split('"')[3],
img:'https://'+result.querySelectorAll('img')[0].rawAttrs.split('"')[1].split('https://')[2],
status: result.querySelector('.status')?.rawText || 'Ongoing',
latestChap:parseInt(result.querySelector('.epxs').innerText.split(' ')[1]),
latestChap:parseFloat(result.querySelector('.epxs').innerText.split(' ')[1]),
};
payload.push(aux);
}
@ -97,7 +97,7 @@ module.exports = class AsuraModule
title:decodeHTML(result.rawAttrs.split('"')[3]),
img:result.querySelectorAll('.limit > img')[0].rawAttrs.split('src="')[1].split(')/')[1].split('"')[0],
status:result.querySelector('.status')?.rawText||'Ongoing',
latestChap:parseInt(result.querySelectorAll('.epxs')[0].innerText.split(' ')[1]),
latestChap:parseFloat(result.querySelectorAll('.epxs')[0].innerText.split(' ')[1]),
};
payload.push(aux);
}
@ -238,7 +238,7 @@ module.exports = class AsuraModule
description = decodeHTML(description.join(' '));
const img = 'https://'+parsed.querySelectorAll('img')[1].rawAttrs.split('src="')[1].split('https://')[2].split('"')[0];
let tags = parsed.querySelectorAll('.mgen')[0].structuredText.split('\n')[0].split(' ');
let latestChap = parseInt(parsed.querySelectorAll('.epcurlast')[0].rawText.split(' ')[1])
let latestChap = parseFloat(parsed.querySelectorAll('.epcurlast')[0].rawText.split(' ')[1])
let table = parsed.querySelectorAll('.infox')[0].querySelectorAll('.fmed');
table.splice(-3);
const aux = {};

@ -52,7 +52,7 @@ module.exports = class ReaperModule
title:result.rawAttrs.split('"')[3],
img:result.querySelectorAll('.limit > img')[0].rawAttrs.split('"')[1],
status:result.querySelector('.status')?.rawText||'Ongoing',
latestChap:parseInt(result.childNodes[1].childNodes[1].childNodes[0].rawText.split(" ")[1]),
latestChap:parseFloat(result.childNodes[1].childNodes[1].childNodes[0].rawText.split(" ")[1]),
};
payload.push(aux);
}
@ -99,7 +99,7 @@ module.exports = class ReaperModule
title:decodeHTML(result.rawAttrs.split('"')[3]),
img:result.querySelectorAll('.limit > img')[0].rawAttrs.split('data-src="')[1].split('"')[0],
status:result.querySelector('.status')?.rawText||'Ongoing',
latestChap:parseInt(result.childNodes[1].childNodes[1].childNodes[0].rawText.split(" ")[1]),
latestChap:parseFloat(result.childNodes[1].childNodes[1].childNodes[0].rawText.split(" ")[1]),
};
payload.push(aux);
}
@ -241,7 +241,7 @@ module.exports = class ReaperModule
const img = parsed.querySelectorAll('img')[1].rawAttrs.split('src="')[1].split('"')[0].includes('data:')? parsed.querySelectorAll('img')[1].rawAttrs.split('data-src="')[1].split('"')[0]:parsed.querySelectorAll('img')[1].rawAttrs.split('src="')[1].split('"')[0];
let table = parsed.querySelectorAll('.infotable')[0].childNodes[0].structuredText.split('\n');
let tags = parsed.querySelectorAll('.seriestugenre')[0].structuredText.split('\n')[0].split(' ');
let latestChap = parseInt(parsed.querySelectorAll('.epcurlast')[0].rawText.split(' ')[1])
let latestChap = parseFloat(parsed.querySelectorAll('.epcurlast')[0].rawText.split(' ')[1])
table.splice(-6);
const aux = {};
for (let i = 0; i < table.length; i += 2) {

@ -77,8 +77,8 @@ async function updateQueue()
{
let chapters = fs.readdirSync(path.join(BaseDir, Scanlators[i], mangas[j]));
if(chapters.length==0) continue
chapters.sort((a, b) => { return parseInt(a.split('_')[1]) - parseInt(b.split('_')[1]) });
let latestDownloaded = parseInt(chapters[chapters.length-1].split('_')[1]);
chapters.sort((a, b) => { return parseFloat(a.split('_')[1]) - parseFloat(b.split('_')[1]) });
let latestDownloaded = parseFloat(chapters[chapters.length-1].split('_')[1]);
let manga = {scanlator:Scanlators[i], title:mangas[j], latestDownloaded}
Mangas.push(manga)
}

@ -431,7 +431,7 @@ module.exports.Chapter = class Chapter
const {List, mangaLink} = await Scanlator.Chapter(this.Link);
const {latestChap } = await Scanlator.GetManga(mangaLink);
//TODO: Defaults for missing info from the modules;
return {List, latestChap,mangaLink, chNum:parseInt(this.chNum), link:this.Link,title:this.title, scanlator:this.scanlator}
return {List, latestChap,mangaLink, chNum:parseFloat(this.chNum), link:this.Link,title:this.title, scanlator:this.scanlator}
}
catch (error)
{

Loading…
Cancel
Save