Skip to content

Commit 1333b38

Browse files
committed
feat: Add .broken with all down statuses
1 parent e3939c1 commit 1333b38

File tree

22 files changed

+83
-9
lines changed

22 files changed

+83
-9
lines changed

plugins/multisrc/fictioneer/generator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const generateAll = function () {
1010
return list.map(source => {
1111
console.log(
1212
`[fictioneer] Generating: ${source.id}${' '.repeat(20 - source.id.length)}`,
13+
source.options?.downSince ? `since: ${source.options?.downSince}` : '',
1314
);
1415
return generator(source);
1516
});
@@ -37,5 +38,6 @@ export default plugin;
3738
lang: source.options?.lang || 'English',
3839
filename: source.sourceName,
3940
pluginScript,
41+
down: source.options?.down || false,
4042
};
4143
};

plugins/multisrc/fictioneer/template.ts

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

77
type FictioneerOptions = {
88
browsePage: string;
9+
down?: boolean;
10+
downSince?: string;
911
lang?: string;
1012
versionIncrements?: number;
1113
};

plugins/multisrc/generate-multisrc-plugins.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const generate = async name => {
3030
pluginsDir,
3131
lang.toLowerCase(),
3232
filename.replace(/[\s-\.]+/g, '') +
33-
`[${name}]${down ? '.down' : ''}.ts`,
33+
`[${name}]${down ? '.broken' : ''}.ts`,
3434
);
3535
fs.writeFileSync(filePath, pluginScript, { encoding: 'utf-8' });
3636
}

plugins/multisrc/hotnovelpub/generator.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ export const generateAll = function () {
3636
return { ...p, filters };
3737
})
3838
.map(metadata => {
39-
console.log(`[hotnovelpub]: Generating`, metadata.id);
39+
console.log(
40+
`[hotnovelpub]: Generating`,
41+
metadata.id,
42+
metadata.options?.downSince
43+
? `since: ${metadata.options?.downSince}`
44+
: '',
45+
);
4046
return generator(metadata);
4147
});
4248
};
@@ -59,5 +65,6 @@ export default plugin;
5965
lang: lang[metadata?.options?.lang || 'en'] || 'english',
6066
filename: metadata.sourceName,
6167
pluginScript,
68+
down: metadata.options?.down || false,
6269
};
6370
};

plugins/multisrc/hotnovelpub/template.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export type HotNovelPubMetadata = {
1313

1414
type HotNovelPubOptions = {
1515
lang?: string;
16+
down?: boolean;
17+
downSince?: string;
1618
};
1719

1820
class HotNovelPubPlugin implements Plugin.PluginBase {

plugins/multisrc/ifreedom/generator.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ const folder = dirname(fileURLToPath(import.meta.url));
99
export const generateAll = function () {
1010
return list.map(metadata => {
1111
metadata.filters = Object.assign(defaultSettings.filters, metadata.filters);
12-
console.log(`[ifreedom]: Generating`, metadata.id);
12+
console.log(
13+
`[ifreedom]: Generating`,
14+
metadata.id,
15+
metadata.options?.downSince
16+
? `since: ${metadata.options?.downSince}`
17+
: '',
18+
);
1319
return generator(metadata);
1420
});
1521
};
@@ -32,5 +38,6 @@ export default plugin;
3238
lang: 'russian',
3339
filename: metadata.sourceName,
3440
pluginScript,
41+
down: metadata.options?.down || false,
3542
};
3643
};

plugins/multisrc/ifreedom/template.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ export type IfreedomMetadata = {
1010
sourceSite: string;
1111
sourceName: string;
1212
filters?: Filters;
13+
options?: IfreedomOptions;
14+
};
15+
16+
type IfreedomOptions = {
17+
lang?: string;
18+
down?: boolean;
19+
downSince?: string;
1320
};
1421

1522
class IfreedomPlugin implements Plugin.PluginBase {

plugins/multisrc/lightnovelworld/generator.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export const generateAll = function () {
1515
source.filters = JSON.parse(filters);
1616
}
1717
console.log(
18-
`[lightnovelworld] Generating: ${source.id}${' '.repeat(20 - source.id.length)} ${source.filters ? '🔎with filters🔍' : '🚫no filters🚫'}`,
18+
`[lightnovelworld] Generating: ${source.id}${' '.repeat(20 - source.id.length)} ${source.options?.down ? '🔽site is down🔽' : source.filters ? '🔎with filters🔍' : '🚫no filters🚫'}`,
19+
source.options?.downSince ? `since: ${source.options?.downSince}` : '',
1920
);
2021
return generator(source);
2122
});
@@ -36,5 +37,6 @@ export default plugin;
3637
lang: source.options?.lang || 'English',
3738
filename: source.sourceName,
3839
pluginScript,
40+
down: source.options?.down || false,
3941
};
4042
};

plugins/multisrc/lightnovelworld/template.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import dayjs from 'dayjs';
77
type LightNovelWorldOptions = {
88
lang?: string;
99
versionIncrements?: number;
10+
down?: boolean;
11+
downSince?: string;
1012
};
1113

1214
export type LightNovelWorldMetadata = {

plugins/multisrc/mtlnovel/generator.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ export const generateAll = function () {
1616
} catch (e) {}
1717
console.log(
1818
`[mtlnovel] Generating: ${source.id}`.padEnd(35),
19-
source.filters ? '🔎with filters🔍' : '🚫 no filters 🚫',
19+
source.options?.down
20+
? '🔽site is down🔽'
21+
: source.filters
22+
? '🔎with filters🔍'
23+
: '🚫 no filters 🚫',
24+
source.options?.downSince ? `since: ${source.options?.downSince}` : '',
2025
);
2126
return generator(source);
2227
});
@@ -38,5 +43,6 @@ export default plugin;
3843
lang: source.options?.lang || 'English',
3944
filename: source.sourceName,
4045
pluginScript,
46+
down: source.options?.down || false,
4147
};
4248
};

0 commit comments

Comments
 (0)