Skip to content

Commit 2025ea7

Browse files
committed
added down status to plugins
1 parent e4e3415 commit 2025ea7

File tree

7 files changed

+124
-4
lines changed

7 files changed

+124
-4
lines changed

scripts/json_plugins.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ for (let language in languages) {
8484
iconUrl: `${STATIC_LINK}/${icon || 'siteNotAvailable.png'}`,
8585
customJS: customJS ? `${STATIC_LINK}/${customJS}` : undefined,
8686
customCSS: customCSS ? `${STATIC_LINK}/${customCSS}` : undefined,
87+
down: plugin.endsWith('.down.js'),
8788
};
8889

8990
if (pluginSet.has(id)) {

scripts/multisrc/generate.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import fs from 'fs';
55
// lang: string;
66
// filename: string;
77
// pluginScript: string;
8+
// down?: boolean;
89
// };
910

1011
// export type ScrpitGeneratorFunction = () => GeneratedScript[];
@@ -19,7 +20,7 @@ const generate = async name => {
1920
if (!isScriptGenerator(generateAll)) return false;
2021
const sources = generateAll();
2122
for (let source of sources) {
22-
const { lang, filename, pluginScript } = source;
23+
const { lang, filename, pluginScript, down } = source;
2324
if (!lang || !filename || !pluginScript) {
2425
console.warn(name, ': lang, filename, pluginScript are required!');
2526
continue;
@@ -28,7 +29,8 @@ const generate = async name => {
2829
const filePath = path.join(
2930
pluginsDir,
3031
lang.toLowerCase(),
31-
filename.replace(/[\s-.]+/g, '') + `[${name}].ts`,
32+
filename.replace(/[\s-\.]+/g, '') +
33+
`[${name}]${down ? '.down' : ''}.ts`,
3234
);
3335
fs.writeFileSync(filePath, pluginScript, { encoding: 'utf-8' });
3436
}

scripts/multisrc/lightnovelwp/generator.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ export const generateAll = function () {
1515
source.filters = JSON.parse(filters).filters;
1616
}
1717
console.log(
18-
`[lightnovelwp] Generating: ${source.id}${' '.repeat(20 - source.id.length)} ${source.filters ? '🔎with filters🔍' : '🚫no filters🚫'}`,
18+
'[lightnovelwp] Generating:',
19+
source.id.padEnd(20),
20+
source.options?.down
21+
? '🔽site is down🔽'
22+
: source.filters
23+
? '🔎with filters🔍'
24+
: '🚫 no filters 🚫',
25+
source.options?.downSince ? `since: ${source.options?.downSince}` : '',
1926
);
2027
return generator(source);
2128
});
@@ -39,5 +46,6 @@ export default plugin;
3946
lang: source.options?.lang || 'English',
4047
filename: source.sourceName,
4148
pluginScript,
49+
down: source.options?.down || false,
4250
};
4351
};

scripts/multisrc/lightnovelwp/template.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { Filters } from '@libs/filterInputs';
88

99
type LightNovelWPOptions = {
1010
reverseChapters?: boolean;
11+
down?: boolean;
12+
downSince?: string;
1113
lang?: string;
1214
versionIncrements?: number;
1315
seriesPath?: string;

scripts/multisrc/madara/generator.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,16 @@ export const generateAll = function () {
1515
source.filters = JSON.parse(filters).filters;
1616
}
1717
console.log(
18-
`[madara] Generating: ${source.id}${' '.repeat(20 - source.id.length)} ${source.filters ? '🔎with filters🔍' : '🚫no filters🚫'}`,
18+
'[madara] Generating:',
19+
metadata.id.padEnd(20),
20+
metadata.options?.down
21+
? '🔽site is down🔽'
22+
: metadata.filters
23+
? '🔎with filters🔍'
24+
: '🚫 no filters 🚫',
25+
metadata.options?.downSince
26+
? `since: ${metadata.options?.downSince}`
27+
: '',
1928
);
2029
return generator(source);
2130
});
@@ -35,5 +44,6 @@ export default plugin;
3544
lang: source.options?.lang || 'English',
3645
filename: source.sourceName,
3746
pluginScript,
47+
down: metadata.options?.down,
3848
};
3949
};

scripts/multisrc/madara/sources.json

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
"useNewChapterEndpoint": true
88
}
99
},
10+
{
11+
"id": "zinnovel",
12+
"sourceSite": "https://zinnovel.com/",
13+
"sourceName": "ZinnNovel",
14+
"options": {
15+
"down": true,
16+
"downSince": "2024-03-04"
17+
}
18+
},
1019
{
1120
"id": "novelTL",
1221
"sourceSite": "https://noveltranslate.com/",
@@ -30,6 +39,15 @@
3039
"useNewChapterEndpoint": true
3140
}
3241
},
42+
{
43+
"id": "freenovel.me",
44+
"sourceSite": "https://freenovel.me/",
45+
"sourceName": "FreeNovelMe",
46+
"options": {
47+
"down": true,
48+
"downSince": "2024-03-04"
49+
}
50+
},
3351
{
3452
"id": "1stkissnovel",
3553
"sourceSite": "https://1stkissnovel.org/",
@@ -90,6 +108,15 @@
90108
"sourceSite": "https://www.webnovelover.com/",
91109
"sourceName": "WebNovelLover"
92110
},
111+
{
112+
"id": "readwebnovels",
113+
"sourceSite": "https://readwebnovels.net/",
114+
"sourceName": "ReadWebNovels",
115+
"options": {
116+
"down": true,
117+
"downSince": "2024-03-04"
118+
}
119+
},
93120
{
94121
"id": "wbnovel",
95122
"sourceSite": "https://wbnovel.com/",
@@ -124,6 +151,16 @@
124151
"lang": "Indonesian"
125152
}
126153
},
154+
{
155+
"id": "onlymtl",
156+
"sourceSite": "https://www.onlymtl.com/",
157+
"sourceName": "OnlyMTL",
158+
"options": {
159+
"useNewChapterEndpoint": true,
160+
"down": true,
161+
"downSince": "2024-03-04"
162+
}
163+
},
127164
{
128165
"id": "hizomanga",
129166
"sourceSite": "https://hizomanga.net/",
@@ -168,6 +205,16 @@
168205
"useNewChapterEndpoint": true
169206
}
170207
},
208+
{
209+
"id": "mtlnovel.club",
210+
"sourceSite": "https://mtlnovel.club/",
211+
"sourceName": "MTLNovel.Club",
212+
"options": {
213+
"useNewChapterEndpoint": true,
214+
"down": true,
215+
"downSince": "2024-03-04"
216+
}
217+
},
171218
{
172219
"id": "guavaread",
173220
"sourceSite": "https://guavaread.com/",
@@ -176,6 +223,26 @@
176223
"useNewChapterEndpoint": true
177224
}
178225
},
226+
{
227+
"id": "sweetEscapeTL",
228+
"sourceSite": "https://sweetescapetranslations.com/",
229+
"sourceName": "Sweet Escape Translations",
230+
"options": {
231+
"useNewChapterEndpoint": false,
232+
"down": true,
233+
"downSince": "2024-03-04"
234+
}
235+
},
236+
{
237+
"id": "novelstic",
238+
"sourceSite": "https://novelstic.com/",
239+
"sourceName": "Novelstic",
240+
"options": {
241+
"useNewChapterEndpoint": true,
242+
"down": true,
243+
"downSince": "2024-03-04"
244+
}
245+
},
179246
{
180247
"id": "neosekaiTLS",
181248
"sourceSite": "https://www.neosekaitranslations.com/",
@@ -196,6 +263,34 @@
196263
"sourceName": "Zetro Translation",
197264
"options": {}
198265
},
266+
{
267+
"id": "nocturneTLS",
268+
"sourceSite": "https://nocturnetls.net/",
269+
"sourceName": "Nocturne Translations",
270+
"options": {
271+
"down": true,
272+
"downSince": "2024-03-04"
273+
}
274+
},
275+
{
276+
"id": "novelroom",
277+
"sourceSite": "https://novelroom.net/",
278+
"sourceName": "Novelroom.net",
279+
"options": {
280+
"down": true,
281+
"downSince": "2024-03-04"
282+
}
283+
},
284+
{
285+
"id": "novelr18",
286+
"sourceSite": "https://novelr18.com/",
287+
"sourceName": "NovelR18",
288+
"options": {
289+
"useNewChapterEndpoint": true,
290+
"down": true,
291+
"downSince": "2024-03-04"
292+
}
293+
},
199294
{
200295
"id": "webnoveloku",
201296
"sourceSite": "https://www.webnoveloku.com/",

scripts/multisrc/madara/template.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const includesAny = (str: string, keywords: string[]) =>
1111

1212
type MadaraOptions = {
1313
useNewChapterEndpoint?: boolean;
14+
down?: boolean;
15+
downSince?: string;
1416
lang?: string;
1517
orderBy?: string;
1618
versionIncrements?: number;

0 commit comments

Comments
 (0)