fix: [NovelBuddy]: Correct Chapter Release Dates (Closes #1048)

This commit is contained in:
Rajarshee Chatterjee
2024-07-14 11:25:40 +05:30
parent 0a8ee9b63b
commit 8835acf981
+8 -5
View File
@@ -6,7 +6,7 @@ class NovelBuddy implements Plugin.PluginBase {
id = 'novelbuddy'; id = 'novelbuddy';
name = 'NovelBuddy.io'; name = 'NovelBuddy.io';
site = 'https://novelbuddy.io/'; site = 'https://novelbuddy.io/';
version = '1.0.0'; version = '1.0.1';
icon = 'src/en/novelbuddy/icon.png'; icon = 'src/en/novelbuddy/icon.png';
parseNovels(loadedCheerio: CheerioAPI) { parseNovels(loadedCheerio: CheerioAPI) {
@@ -111,10 +111,13 @@ class NovelBuddy implements Plugin.PluginBase {
'oct', 'oct',
'nov', 'nov',
'dec', 'dec',
].join('|'); ];
const rx = new RegExp(`(${months}) (\\d{1,2}), (\\d{4})`, 'i').exec( const monthsJoined = months.join('|');
releaseDate,
); const rx = new RegExp(
`(${monthsJoined}) (\\d{1,2}), (\\d{4})`,
'i',
).exec(releaseDate);
if (!rx) return; if (!rx) return;
const year = +rx[3]; const year = +rx[3];
const month = months.indexOf(rx[1].toLowerCase()); const month = months.indexOf(rx[1].toLowerCase());