Add TopLiba (#1003)

* test

* cleanup

deleted unused `fetchFile` import
replaced fetch with `fetchApi`

* eslint

* fix

* fix multi

* Hmm, what to do next.

* test URLSearchParams

* fix
This commit is contained in:
Rider21
2024-06-30 07:28:11 +03:00
committed by GitHub
parent 938e3b16a3
commit fae73534dd
121 changed files with 10534 additions and 8079 deletions
+4 -17
View File
@@ -1,12 +1,12 @@
import { Plugin } from '@typings/plugin';
import { FilterTypes, Filters } from '@libs/filterInputs';
import { defaultCover } from '@libs/defaultCover';
import { fetchApi, fetchFile } from '@libs/fetch';
import { fetchApi } from '@libs/fetch';
import { NovelStatus } from '@libs/novelStatus';
import { storage, localStorage } from '@libs/storage';
import dayjs from 'dayjs';
const statusKey: { [key: number]: string } = {
const statusKey: Record<number, string> = {
1: NovelStatus.Ongoing,
2: NovelStatus.Completed,
3: NovelStatus.OnHiatus,
@@ -126,7 +126,7 @@ class RLIB implements Plugin.PluginBase {
novel.genres = genres.join(', ');
}
const branch_id: { [key: number]: string } = {};
const branch_id: Record<number, string> = {};
if (data.teams.length) {
data.teams.forEach(
({ name, details }) => (branch_id[details?.branch_id || '0'] = name),
@@ -477,7 +477,7 @@ class RLIB implements Plugin.PluginBase {
export default new RLIB();
function jsonToHtml(json: HTML[], html: string = '') {
function jsonToHtml(json: HTML[], html = '') {
json.forEach(element => {
switch (element.type) {
case 'hardBreak':
@@ -592,12 +592,6 @@ interface User {
id: number;
}
interface Rating {
average: string;
votes: number;
votesFormated: string;
}
interface DataClass {
id: number;
name: string;
@@ -717,10 +711,3 @@ interface DataChapter {
branches_count: number;
branches: Branch[];
}
interface BranchesEntity {
id: number;
branch_id?: number;
created_at: string;
teams?: BranchTeam[];
user: User;
}