feat: [Novel Bin]: Update Site URL (#1214)

This commit is contained in:
Batorian
2024-10-08 20:01:25 +02:00
committed by GitHub
parent 93cb8a171b
commit e9179e957d
+10 -6
View File
@@ -7,8 +7,8 @@ class NovelBin implements Plugin.PluginBase {
id = 'novelbin'; id = 'novelbin';
name = 'Novel Bin'; name = 'Novel Bin';
icon = 'src/en/novelbin/icon.png'; icon = 'src/en/novelbin/icon.png';
site = 'https://binnovel.com/'; site = 'https://novelbin.com/';
version = '1.0.1'; version = '1.1.0';
imageRequestInit?: Plugin.ImageRequestInit | undefined = { imageRequestInit?: Plugin.ImageRequestInit | undefined = {
headers: { headers: {
'referrer': this.site, 'referrer': this.site,
@@ -43,11 +43,15 @@ class NovelBin implements Plugin.PluginBase {
async popularNovels( async popularNovels(
page: number, page: number,
{ filters }: Plugin.PopularNovelsOptions<Filters>, { showLatestNovels, filters }: Plugin.PopularNovelsOptions<Filters>,
): Promise<Plugin.NovelItem[]> { ): Promise<Plugin.NovelItem[]> {
let link = this.site; let link = this.site;
if (filters.genre.value !== '') link += `gen/${filters.genre.value}`;
if (showLatestNovels) link += 'sort/latest';
else {
if (filters.genre.value !== '') link += `genre/${filters.genre.value}`;
else link += `sort/${filters.sort.value}`; else link += `sort/${filters.sort.value}`;
}
if (filters.complete.value) link += `/completed`; if (filters.complete.value) link += `/completed`;
@@ -159,7 +163,7 @@ class NovelBin implements Plugin.PluginBase {
}, },
genre: { genre: {
value: '', value: '',
label: 'Genres', label: "Genres (Cancels out 'Sort by')",
options: [ options: [
{ label: 'None', value: '' }, { label: 'None', value: '' },
{ label: 'Action', value: 'action' }, { label: 'Action', value: 'action' },
@@ -224,8 +228,8 @@ class NovelBin implements Plugin.PluginBase {
type: FilterTypes.Picker, type: FilterTypes.Picker,
}, },
complete: { complete: {
label: 'Show Completed Novels Only',
value: false, value: false,
label: 'Show Completed Novels Only',
type: FilterTypes.Switch, type: FilterTypes.Switch,
}, },
} satisfies Filters; } satisfies Filters;