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
+20 -5
View File
@@ -1,15 +1,24 @@
/* eslint-disable no-case-declarations */
import { fetchApi } from '@libs/fetch';
import { Filters, FilterTypes } from '@libs/filterInputs';
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 {
id = 'genesistudio';
name = 'Genesis';
icon = 'src/en/genesis/icon.png';
customCSS = 'src/en/genesis/customCSS.css';
site = 'https://genesistudio.com';
version = '1.0.2';
version = '1.0.3';
imageRequestInit?: Plugin.ImageRequestInit | undefined = {
headers: {
'referrer': this.site,
@@ -75,8 +84,10 @@ class Genesis implements Plugin.PluginBase {
novel.status = data[novelData.release_days] ? 'Ongoing' : 'Completed';
const chapterData = data[data[0].chapters];
const freeChapterData = chapterData.free;
// const premiumChapterData = chapterData.premium;
const freeChapterData = chapterData.free_chapters;
/** Premium chapters not yet implemented */
// const premiumChapterData = chapterData.premium_chapters;
novel.chapters = data[freeChapterData]
.map((index: number) => data[index])
@@ -101,7 +112,11 @@ class Genesis implements Plugin.PluginBase {
.filter((node: { type: string }) => node.type === 'data')
.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(
+7 -4
View File
@@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin';
class NovelUpdates implements Plugin.PluginBase {
id = 'novelupdates';
name = 'Novel Updates';
version = '0.7.8';
version = '0.7.9';
icon = 'src/en/novelupdates/icon.png';
customCSS = 'src/en/novelupdates/customCSS.css';
site = 'https://www.novelupdates.com/';
@@ -254,7 +254,12 @@ class NovelUpdates implements Plugin.PluginBase {
const data_genesis = nodes_genesis
.filter((node: { type: string }) => node.type === 'data')
.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;
case 'helscans':
chapterTitle =
@@ -746,7 +751,6 @@ class NovelUpdates implements Plugin.PluginBase {
* - ElloMTL
* - Femme Fables
* - Gem Novels
* - Genesis Translations (Manually added)
* - Goblinslate
* - Hel Scans (Outlier)
* - ippotranslations
@@ -791,7 +795,6 @@ class NovelUpdates implements Plugin.PluginBase {
'.chapter-warning',
'.entry-meta',
'.ezoic-ad',
'.genesistls-watermark',
'.mb-center',
'.modern-footnotes-footnote__note',
'.patreon-widget',