From aa8feeaac909c9d757528f27bad6afbbad292076 Mon Sep 17 00:00:00 2001 From: Rider21 <58046032+Rider21@users.noreply.github.com> Date: Sat, 30 Nov 2024 05:10:57 +0300 Subject: [PATCH] plugin fix (#1345) * test * float * hotfix * -float * **** * \ * misprint * it's working lol --- src/plugins/english/mvlempyr.ts | 4 ++-- src/plugins/russian/ranobelib.ts | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/plugins/english/mvlempyr.ts b/src/plugins/english/mvlempyr.ts index 0a84b27..f411fdd 100644 --- a/src/plugins/english/mvlempyr.ts +++ b/src/plugins/english/mvlempyr.ts @@ -29,7 +29,7 @@ class MVLEMPYRPlugin implements Plugin.PluginBase { name = 'MVLEMPYR'; icon = 'src/en/mvlempyr/icon.png'; site = 'https://www.mvlempyr.com/'; - version = '1.0.2'; + version = '1.0.3'; _chapSite = 'https://chp.mvlempyr.net/'; _allNovels: (Plugin.NovelItem & ExtraNovelData)[] | undefined; @@ -348,7 +348,7 @@ class MVLEMPYRPlugin implements Plugin.PluginBase { chapters: posts.map(chap => ({ name: chap.acf.ch_name, path: 'chapter/' + chap.acf.novel_code + '-' + chap.acf.chapter_number, - date: chap.date, + releaseTime: chap.date, chapterNumber: chap.acf.chapter_number, })), status: loadedCheerio('div.novelstatustextmedium').text(), diff --git a/src/plugins/russian/ranobelib.ts b/src/plugins/russian/ranobelib.ts index 184e9f6..2ae9102 100644 --- a/src/plugins/russian/ranobelib.ts +++ b/src/plugins/russian/ranobelib.ts @@ -18,7 +18,7 @@ class RLIB implements Plugin.PluginBase { name = 'RanobeLib'; site = 'https://ranobelib.me'; apiSite = 'https://api.mangalib.me/api/manga/'; - version = '2.1.1'; + version = '2.1.2'; icon = 'src/ru/ranobelib/icon.png'; webStorageUtilized = true; @@ -126,7 +126,7 @@ class RLIB implements Plugin.PluginBase { novel.genres = genres.join(', '); } - const branch_name: Record = {}; + const branch_name: Record = { 0: 'главная страница' }; if (data.teams.length) { data.teams.forEach( ({ name, details }) => (branch_name[details?.branch_id || '0'] = name), @@ -162,7 +162,7 @@ class RLIB implements Plugin.PluginBase { (branch_id || ''), releaseTime: dayjs(created_at).format('LLL'), chapterNumber: chapter.index, - page: branch_name[branch_id || '0'], + page: branch_name[branch_id || '0'] || 'Неизвестный', }), ), ); @@ -170,10 +170,14 @@ class RLIB implements Plugin.PluginBase { if (chapters.length && data.teams.length > 1) { //For whatever reason, the chapters overlap with another page. chapters.sort((chapterA, chapterB) => { - if (chapterA.page !== chapterB.page) { + if ( + chapterA.page && + chapterB.page && + chapterA.page !== chapterB.page + ) { return chapterA.page.localeCompare(chapterB.page); } - return chapterA.chapterNumber - chapterB.chapterNumber; + return (chapterA.chapterNumber || 0) - (chapterB.chapterNumber || 0); }); }