Skip to content

Commit 6ba2db6

Browse files
committed
added down status to plugins
1 parent b07678f commit 6ba2db6

7 files changed

Lines changed: 124 additions & 4 deletions

File tree

scripts/json_plugins.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ for (let language in languages) {
8282
version,
8383
url: `${PLUGIN_LINK}/${language.toLowerCase()}/${plugin}`,
8484
iconUrl: `${ICON_LINK}/${icon || 'siteNotAvailable.png'}`,
85+
down: plugin.endsWith('.down.js'),
8586
};
8687

8788
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);
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
interface 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);
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/",
@@ -29,6 +38,15 @@
2938
"useNewChapterEndpoint": true
3039
}
3140
},
41+
{
42+
"id": "freenovel.me",
43+
"sourceSite": "https://freenovel.me/",
44+
"sourceName": "FreeNovelMe",
45+
"options": {
46+
"down": true,
47+
"downSince": "2024-03-04"
48+
}
49+
},
3250
{
3351
"id": "1stkissnovel",
3452
"sourceSite": "https://1stkissnovel.org/",
@@ -89,6 +107,15 @@
89107
"sourceSite": "https://www.webnovelover.com/",
90108
"sourceName": "WebNovelLover"
91109
},
110+
{
111+
"id": "readwebnovels",
112+
"sourceSite": "https://readwebnovels.net/",
113+
"sourceName": "ReadWebNovels",
114+
"options": {
115+
"down": true,
116+
"downSince": "2024-03-04"
117+
}
118+
},
92119
{
93120
"id": "wbnovel",
94121
"sourceSite": "https://wbnovel.com/",
@@ -122,6 +149,16 @@
122149
"lang": "Indonesian"
123150
}
124151
},
152+
{
153+
"id": "onlymtl",
154+
"sourceSite": "https://www.onlymtl.com/",
155+
"sourceName": "OnlyMTL",
156+
"options": {
157+
"useNewChapterEndpoint": true,
158+
"down": true,
159+
"downSince": "2024-03-04"
160+
}
161+
},
125162
{
126163
"id": "hizomanga",
127164
"sourceSite": "https://hizomanga.net/",
@@ -166,6 +203,16 @@
166203
"useNewChapterEndpoint": true
167204
}
168205
},
206+
{
207+
"id": "mtlnovel.club",
208+
"sourceSite": "https://mtlnovel.club/",
209+
"sourceName": "MTLNovel.Club",
210+
"options": {
211+
"useNewChapterEndpoint": true,
212+
"down": true,
213+
"downSince": "2024-03-04"
214+
}
215+
},
169216
{
170217
"id": "guavaread",
171218
"sourceSite": "https://guavaread.com/",
@@ -174,6 +221,26 @@
174221
"useNewChapterEndpoint": true
175222
}
176223
},
224+
{
225+
"id": "sweetEscapeTL",
226+
"sourceSite": "https://sweetescapetranslations.com/",
227+
"sourceName": "Sweet Escape Translations",
228+
"options": {
229+
"useNewChapterEndpoint": false,
230+
"down": true,
231+
"downSince": "2024-03-04"
232+
}
233+
},
234+
{
235+
"id": "novelstic",
236+
"sourceSite": "https://novelstic.com/",
237+
"sourceName": "Novelstic",
238+
"options": {
239+
"useNewChapterEndpoint": true,
240+
"down": true,
241+
"downSince": "2024-03-04"
242+
}
243+
},
177244
{
178245
"id": "neosekaiTLS",
179246
"sourceSite": "https://www.neosekaitranslations.com/",
@@ -194,6 +261,34 @@
194261
"sourceName": "Zetro Translation",
195262
"options": {}
196263
},
264+
{
265+
"id": "nocturneTLS",
266+
"sourceSite": "https://nocturnetls.net/",
267+
"sourceName": "Nocturne Translations",
268+
"options": {
269+
"down": true,
270+
"downSince": "2024-03-04"
271+
}
272+
},
273+
{
274+
"id": "novelroom",
275+
"sourceSite": "https://novelroom.net/",
276+
"sourceName": "Novelroom.net",
277+
"options": {
278+
"down": true,
279+
"downSince": "2024-03-04"
280+
}
281+
},
282+
{
283+
"id": "novelr18",
284+
"sourceSite": "https://novelr18.com/",
285+
"sourceName": "NovelR18",
286+
"options": {
287+
"useNewChapterEndpoint": true,
288+
"down": true,
289+
"downSince": "2024-03-04"
290+
}
291+
},
197292
{
198293
"id": "webnoveloku",
199294
"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
interface MadaraOptions {
1313
useNewChapterEndpoint?: boolean;
14+
down?: boolean;
15+
downSince?: string;
1416
lang?: string;
1517
orderBy?: string;
1618
versionIncrements?: number;

0 commit comments

Comments
 (0)