redownload implemented

This commit is contained in:
2022-07-08 13:33:19 +02:00
parent f93008fe29
commit 809b021062
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ At first start it will create an empty config file `./novelConfig.conf`, adjust
"coverURL": "", // Autofill "coverURL": "", // Autofill
"lastChapterURL": false, // Autofill; Can be used if not starting from the first chapter, first chapter downloaded will be NEXT from this "lastChapterURL": false, // Autofill; Can be used if not starting from the first chapter, first chapter downloaded will be NEXT from this
"lastVolume": 0, // Autofill; Can be used if not starting from the first chapter, first eBook number created will be NEXT from this "lastVolume": 0, // Autofill; Can be used if not starting from the first chapter, first eBook number created will be NEXT from this
"completed": false, // Autofill; Set to false with settings above to download chapters again "completed": false, // Autofill; Set to false with settings above to download chapters again; Set to true by hand to skip checking the novel
"hosting": "NF", // Hosting code, see "supportedHosting" "hosting": "NF", // Hosting code, see "supportedHosting"
"volumeChapterCount": 5, // After how many new/unread chapters to send a new eBook, ignored if WebNovel is completed "volumeChapterCount": 5, // After how many new/unread chapters to send a new eBook, ignored if WebNovel is completed
"completedVolumeChapterCount": 50, // How many chapters to pack per eBook "completedVolumeChapterCount": 50, // How many chapters to pack per eBook
+6 -6
View File
@@ -18,7 +18,7 @@ function cleanPath(pathToClean) {
let isAbsolute = path.isAbsolute(cleanPath); let isAbsolute = path.isAbsolute(cleanPath);
cleanPath = cleanPath.replace(regex, ''); cleanPath = cleanPath.replace(regex, '');
if (/^win/i.test(process.platform) && isAbsolute) { if (/^win/i.test(process.platform) && isAbsolute) {
cleanPath = `${cleanPath.slice(0, 1)}:${cleanPath.slice(1)}` cleanPath = `${cleanPath.slice(0, 1)}:${cleanPath.slice(1)}`;
} }
return cleanPath; return cleanPath;
@@ -86,7 +86,7 @@ async function loadConfig() {
"title": "", "title": "",
"author": "", "author": "",
"coverURL": "", "coverURL": "",
"lastChapterURL": false, "lastChapterURL": "",
"lastVolume": 0, "lastVolume": 0,
"completed": false, "completed": false,
"hosting": "NF", "hosting": "NF",
@@ -162,10 +162,10 @@ function sendEbook(subject, ebookAttachments) {
if (config['sendEmail']) { if (config['sendEmail']) {
let splicedAttachments = []; let splicedAttachments = [];
while (ebookAttachments.length > config['emailAttachments']) { while (ebookAttachments.length > config['emailAttachments']) {
splicedAttachments.push(ebookAttachments.splice(0, config['emailAttachments'])) splicedAttachments.push(ebookAttachments.splice(0, config['emailAttachments']));
} }
if (ebookAttachments.length > 0) { if (ebookAttachments.length > 0) {
splicedAttachments.push(ebookAttachments) splicedAttachments.push(ebookAttachments);
} }
for (let i = 0; i < splicedAttachments.length; ++i) { for (let i = 0; i < splicedAttachments.length; ++i) {
@@ -175,7 +175,7 @@ function sendEbook(subject, ebookAttachments) {
subject: subject + ' part ' + (i + 1), subject: subject + ' part ' + (i + 1),
text: subject + ' part ' + (i + 1), text: subject + ' part ' + (i + 1),
attachments: splicedAttachments[i] attachments: splicedAttachments[i]
} };
transporter.sendMail(message, (err) => { transporter.sendMail(message, (err) => {
if (err) if (err)
@@ -185,7 +185,7 @@ function sendEbook(subject, ebookAttachments) {
console.log(`Sent volumes:`); console.log(`Sent volumes:`);
log(`Sent volumes:`); log(`Sent volumes:`);
splicedAttachments[i].forEach(elem => console.log(elem['filename'])) splicedAttachments[i].forEach(elem => console.log(elem['filename']));
} }
} }
} }