disabled send email when redownloading; removed TODO
This commit is contained in:
@@ -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
|
||||||
},
|
},
|
||||||
|
|||||||
+18
-11
@@ -26,14 +26,14 @@ function cleanPath(pathToClean) {
|
|||||||
|
|
||||||
function padNumber(num, len) {
|
function padNumber(num, len) {
|
||||||
let strNum = num.toString();
|
let strNum = num.toString();
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (negative ? '-' : '') + strNum;
|
return (negative ? '-' : '') + strNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
function log(text) {
|
function log(text) {
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,7 +361,7 @@ async function main() {
|
|||||||
|
|
||||||
const maxVolume = novel['completed'] ? startVol + Math.ceil(totalChapters / novel['completedVolumeChapterCount']) : startVol + Math.floor(totalChapters / novel['completedVolumeChapterCount']);
|
const maxVolume = novel['completed'] ? startVol + Math.ceil(totalChapters / novel['completedVolumeChapterCount']) : startVol + Math.floor(totalChapters / novel['completedVolumeChapterCount']);
|
||||||
const maxVolLen = (novel['completed'] ? maxVolume :
|
const maxVolLen = (novel['completed'] ? maxVolume :
|
||||||
maxVolume + Math.floor((chapters.length - (maxVolume * novel['completedVolumeChapterCount'])) / novel['volumeChapterCount'])).toString().length;
|
maxVolume + Math.floor((chapters.length - (maxVolume * novel['completedVolumeChapterCount'])) / novel['volumeChapterCount'])).toString().length;
|
||||||
|
|
||||||
let ebookAttachments = [];
|
let ebookAttachments = [];
|
||||||
|
|
||||||
@@ -433,7 +433,14 @@ async function main() {
|
|||||||
|
|
||||||
chapters.splice(0, chap);
|
chapters.splice(0, chap);
|
||||||
}
|
}
|
||||||
sendEbook(novel['title'], ebookAttachments);
|
if (!novel['redownload']) {
|
||||||
|
sendEbook(novel['title'], ebookAttachments);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
novel['redownload'] = false;
|
||||||
|
config['novels'][i] = clone(novel);
|
||||||
|
saveConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user