disabled send email when redownloading; removed TODO

This commit is contained in:
2022-07-07 09:07:33 +02:00
parent 0346974211
commit f93008fe29
2 changed files with 20 additions and 13 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ At first start it will create an empty config file `./novelConfig.conf`, adjust
"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
"redownload": false // TODO: redownload all chapters, repack into volumes with completedVolumeChapterCount, do not send via email, intended for completed series archiving "redownload": false // Redownload all chapters, repack into volumes with completedVolumeChapterCount, do not send via email, intended for completed series archiving
"sendOnly": false, // TODO: only send epub files via email, for cases with external source of epub files "sendOnly": false, // TODO: only send epub files via email, for cases with external source of epub files
"sendOnlyRegex": ""(?<volume>\\d*). (?<title>.*); (?<author>.*)"" // TODO: metadata regex for extracting information from filename for external sources "sendOnlyRegex": ""(?<volume>\\d*). (?<title>.*); (?<author>.*)"" // TODO: metadata regex for extracting information from filename for external sources
}, },
+11 -4
View File
@@ -29,7 +29,7 @@ function padNumber(num, len) {
let negative = num < 0; let negative = num < 0;
if (negative) strNum = strNum.substr(1); if (negative) strNum = strNum.substr(1);
while(strNum.length < len) { while (strNum.length < len) {
strNum = '0' + strNum; strNum = '0' + strNum;
} }
@@ -92,7 +92,7 @@ async function loadConfig() {
"hosting": "NF", "hosting": "NF",
"volumeChapterCount": 5, "volumeChapterCount": 5,
"completedVolumeChapterCount": 50, "completedVolumeChapterCount": 50,
"redownload": false, // TODO: redownload all chapters, repack into volumes with completedVolumeChapterCount, do not send via email, intended for completed series archiving or resetting "lastVolume" to a more reasonable number "redownload": false,
"sendOnly": false, // TODO: only send epub files via email, for cases with external source of epub files or after "redownload" "sendOnly": false, // TODO: only send epub files via email, for cases with external source of epub files or after "redownload"
"sendOnlyRegex": "(?<volume>\\d*). (?<title>.*); (?<author>.*)" // TODO: metadata regex for extracting information from filename for external sources "sendOnlyRegex": "(?<volume>\\d*). (?<title>.*); (?<author>.*)" // TODO: metadata regex for extracting information from filename for external sources
}, },
@@ -337,8 +337,8 @@ async function main() {
novel['lastChapterURL'] = novelInfo[3]; novel['lastChapterURL'] = novelInfo[3];
let chapter = await fetchChapter(novelInfo[3], 'NF'); let chapter = await fetchChapter(novelInfo[3], 'NF');
console.log('Download chapter ' + chapters.length + ' ' + novelInfo[3]); console.log('Downloaded chapter: ' + chapters.length + ' ' + novelInfo[3]);
log('Download chapter ' + chapters.length + ' ' + novelInfo[3]); log('Downloaded chapter: ' + chapters.length + ' ' + novelInfo[3]);
chapters.push(chapter); chapters.push(chapter);
} }
@@ -433,8 +433,15 @@ async function main() {
chapters.splice(0, chap); chapters.splice(0, chap);
} }
if (!novel['redownload']) {
sendEbook(novel['title'], ebookAttachments); sendEbook(novel['title'], ebookAttachments);
} }
else {
novel['redownload'] = false;
config['novels'][i] = clone(novel);
saveConfig();
}
}
} }
} }