fix: [Genesis]: Fix Chapter Content (#1190)

* genesis: fix missing chapter content

* genesis: remove genesistls and fix NU

* genesis: revert version

* genesis: update version
This commit is contained in:
Batorian
2024-09-17 18:59:23 +02:00
committed by GitHub
parent 9ed284ccf4
commit b4a779a109
3 changed files with 27 additions and 19 deletions
@@ -90,16 +90,6 @@
"reverseChapters": true "reverseChapters": true
} }
}, },
{
"id": "genesistls",
"sourceSite": "https://genesistls.com/",
"sourceName": "GenesisTls (Deprecated)",
"options": {
"lang": "English",
"reverseChapters": false,
"customJs": "$('.genesistls-watermark').remove();$('.epcontent p').each((i, el) => { if ($(el).html() === ' ') $(el).remove(); });"
}
},
{ {
"id": "pandamtl", "id": "pandamtl",
"sourceSite": "https://pandamtl.com/", "sourceSite": "https://pandamtl.com/",
+20 -5
View File
@@ -1,15 +1,24 @@
/* eslint-disable no-case-declarations */
import { fetchApi } from '@libs/fetch'; import { fetchApi } from '@libs/fetch';
import { Filters, FilterTypes } from '@libs/filterInputs'; import { Filters, FilterTypes } from '@libs/filterInputs';
import { Plugin } from '@typings/plugin'; import { Plugin } from '@typings/plugin';
/**
* Example for novel API:
* https://genesistudio.com/novels/dlh/__data.json?x-sveltekit-invalidated=001
* -> to view novel remove '__data.json?x-sveltekit-invalidated=001'
*
* Example for chapter API:
* https://genesistudio.com/viewer/2443/__data.json?x-sveltekit-invalidated=001
* -> to view chapter remove '__data.json?x-sveltekit-invalidated=001'
*/
class Genesis implements Plugin.PluginBase { class Genesis implements Plugin.PluginBase {
id = 'genesistudio'; id = 'genesistudio';
name = 'Genesis'; name = 'Genesis';
icon = 'src/en/genesis/icon.png'; icon = 'src/en/genesis/icon.png';
customCSS = 'src/en/genesis/customCSS.css'; customCSS = 'src/en/genesis/customCSS.css';
site = 'https://genesistudio.com'; site = 'https://genesistudio.com';
version = '1.0.2'; version = '1.0.3';
imageRequestInit?: Plugin.ImageRequestInit | undefined = { imageRequestInit?: Plugin.ImageRequestInit | undefined = {
headers: { headers: {
'referrer': this.site, 'referrer': this.site,
@@ -75,8 +84,10 @@ class Genesis implements Plugin.PluginBase {
novel.status = data[novelData.release_days] ? 'Ongoing' : 'Completed'; novel.status = data[novelData.release_days] ? 'Ongoing' : 'Completed';
const chapterData = data[data[0].chapters]; const chapterData = data[data[0].chapters];
const freeChapterData = chapterData.free; const freeChapterData = chapterData.free_chapters;
// const premiumChapterData = chapterData.premium;
/** Premium chapters not yet implemented */
// const premiumChapterData = chapterData.premium_chapters;
novel.chapters = data[freeChapterData] novel.chapters = data[freeChapterData]
.map((index: number) => data[index]) .map((index: number) => data[index])
@@ -101,7 +112,11 @@ class Genesis implements Plugin.PluginBase {
.filter((node: { type: string }) => node.type === 'data') .filter((node: { type: string }) => node.type === 'data')
.map((node: { data: any }) => node.data)[0]; .map((node: { data: any }) => node.data)[0];
return data[data[0].content] + data[data[0].footnotes] ?? ''; /** May change in the future */
const content = data[19];
const footnotes = data[data[0].footnotes];
return content + footnotes ?? '';
} }
async searchNovels( async searchNovels(
+7 -4
View File
@@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin';
class NovelUpdates implements Plugin.PluginBase { class NovelUpdates implements Plugin.PluginBase {
id = 'novelupdates'; id = 'novelupdates';
name = 'Novel Updates'; name = 'Novel Updates';
version = '0.7.8'; version = '0.7.9';
icon = 'src/en/novelupdates/icon.png'; icon = 'src/en/novelupdates/icon.png';
customCSS = 'src/en/novelupdates/customCSS.css'; customCSS = 'src/en/novelupdates/customCSS.css';
site = 'https://www.novelupdates.com/'; site = 'https://www.novelupdates.com/';
@@ -254,7 +254,12 @@ class NovelUpdates implements Plugin.PluginBase {
const data_genesis = nodes_genesis const data_genesis = nodes_genesis
.filter((node: { type: string }) => node.type === 'data') .filter((node: { type: string }) => node.type === 'data')
.map((node: { data: any }) => node.data)[0]; .map((node: { data: any }) => node.data)[0];
chapterText = data_genesis[data_genesis[0].content];
/** May change in the future */
const content_genesis = data_genesis[19];
const footnotes_genesis = data_genesis[data_genesis[0].footnotes];
chapterText = content_genesis + footnotes_genesis ?? '';
break; break;
case 'helscans': case 'helscans':
chapterTitle = chapterTitle =
@@ -746,7 +751,6 @@ class NovelUpdates implements Plugin.PluginBase {
* - ElloMTL * - ElloMTL
* - Femme Fables * - Femme Fables
* - Gem Novels * - Gem Novels
* - Genesis Translations (Manually added)
* - Goblinslate * - Goblinslate
* - Hel Scans (Outlier) * - Hel Scans (Outlier)
* - ippotranslations * - ippotranslations
@@ -791,7 +795,6 @@ class NovelUpdates implements Plugin.PluginBase {
'.chapter-warning', '.chapter-warning',
'.entry-meta', '.entry-meta',
'.ezoic-ad', '.ezoic-ad',
'.genesistls-watermark',
'.mb-center', '.mb-center',
'.modern-footnotes-footnote__note', '.modern-footnotes-footnote__note',
'.patreon-widget', '.patreon-widget',