fix: linter issues
This commit is contained in:
@@ -10,7 +10,7 @@ class NovelDeGlacePlugin implements Plugin.PluginBase {
|
||||
name = 'NovelDeGlace';
|
||||
icon = 'src/fr/noveldeglace/icon.png';
|
||||
site = 'https://noveldeglace.com/';
|
||||
version = '1.0.4';
|
||||
version = '1.0.5';
|
||||
|
||||
async getCheerio(url: string): Promise<CheerioAPI | undefined> {
|
||||
const r = await fetchApi(url, {
|
||||
@@ -86,10 +86,7 @@ class NovelDeGlacePlugin implements Plugin.PluginBase {
|
||||
|
||||
const novel: Plugin.SourceNovel = { path: novelPath, name: 'Untitled' };
|
||||
|
||||
novel.name =
|
||||
(
|
||||
$('div.entry-content > div > strong')[0].nextSibling as string | null
|
||||
)?.nodeValue?.trim() || 'Untitled';
|
||||
novel.name = $('span.current').text().trim();
|
||||
|
||||
novel.cover = $('.su-row > div > div > img').attr('src') || defaultCover;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Cheerio, CheerioAPI, load, Element } from 'cheerio';
|
||||
import { Cheerio, CheerioAPI, load } from 'cheerio';
|
||||
import { Element } from 'domhandler';
|
||||
import { fetchApi } from '@libs/fetch';
|
||||
import { Plugin } from '@/types/plugin';
|
||||
import { defaultCover } from '@libs/defaultCover';
|
||||
@@ -9,12 +10,12 @@ class XiaowazPlugin implements Plugin.PluginBase {
|
||||
name = 'Xiaowaz';
|
||||
icon = 'src/fr/xiaowaz/icon.png';
|
||||
site = 'https://xiaowaz.fr';
|
||||
version = '1.0.1';
|
||||
version = '1.0.2';
|
||||
static novels: Plugin.NovelItem[] | undefined;
|
||||
|
||||
async getCheerio(url: string): Promise<CheerioAPI> {
|
||||
let retries = 5; // when fetching for images the sites sometimes terminates the connection
|
||||
let returnError: any;
|
||||
let returnError: unknown;
|
||||
while (retries > 0) {
|
||||
try {
|
||||
const r = await fetchApi(url);
|
||||
@@ -29,7 +30,9 @@ class XiaowazPlugin implements Plugin.PluginBase {
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
}
|
||||
}
|
||||
throw new Error(returnError ? returnError : 'Error fetching the page');
|
||||
throw new Error(
|
||||
returnError ? String(returnError) : 'Error fetching the page',
|
||||
);
|
||||
}
|
||||
|
||||
async getAllNovels(): Promise<Plugin.NovelItem[]> {
|
||||
|
||||
Reference in New Issue
Block a user