koishi-plugin-anime-schedule 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.js +3 -1
- package/lib/services/digest.d.ts +7 -13
- package/lib/services/digest.js +11 -28
- package/package.json +1 -1
- package/readme.md +1 -1
package/lib/config.js
CHANGED
|
@@ -70,7 +70,9 @@ exports.Config = koishi_1.Schema.intersect([
|
|
|
70
70
|
.default(0),
|
|
71
71
|
longRunningThreshold: koishi_1.Schema.number()
|
|
72
72
|
.min(0).step(1)
|
|
73
|
-
.description('剔除长期连载番的话数阈值,0
|
|
73
|
+
.description('剔除长期连载番的话数阈值,0 为不过滤。'
|
|
74
|
+
+ '展示话数达到该值的作品整条不显示——海螺小姐、宝可梦 地平线这类周更多年的作品'
|
|
75
|
+
+ '话数会一直涨,而一季 12~24 话的当季番永远达不到,所以填 64 这类值即可')
|
|
74
76
|
.default(0),
|
|
75
77
|
}),
|
|
76
78
|
}).description('推送内容'),
|
package/lib/services/digest.d.ts
CHANGED
|
@@ -65,25 +65,19 @@ export declare class DigestService {
|
|
|
65
65
|
* 这类作品(海螺小姐、樱桃小丸子、宝可梦 地平线、巧虎、战斗陀螺 X…)确实每周都在播,
|
|
66
66
|
* 收录它们并不算错,但很多人不把它们当作「本季新番」,任其出现会让表格变得嘈杂。
|
|
67
67
|
*
|
|
68
|
-
*
|
|
68
|
+
* 判据只有一条:**展示话数 ≥ 阈值**。长期连载番的本集数自然会涨得很高,而一季 12~24
|
|
69
|
+
* 话的当季番永远达不到阈值,因此不需要再引入别的条件。
|
|
69
70
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
71
|
+
* 早先这里还叠加了「AniList 未给出总话数(`episodes === null`)」作为前提,但那条实际
|
|
72
|
+
* 上没有生效:大部分条目在闸门 2 之前就被筛掉,取不到 AniList 状态,于是「有状态」
|
|
73
|
+
* 这个前提直接为假,该剔的长期番反而漏剔(实测 `キラキラADらっこちゃん` 第 239 话、
|
|
74
|
+
* `ギャビーのドールハウス` 第 131 话都因此留在表里)。去掉它之后判据不再依赖网络,
|
|
75
|
+
* 行为更可预测,也不会再被限流影响。
|
|
73
76
|
*
|
|
74
77
|
* **必须在条目构建之后调用**:`applyAiringSchedule` 内部会按作品去重,去重前后的
|
|
75
78
|
* 「第几话」可能不同。判据要落在**最终展示的话数**上。
|
|
76
79
|
*
|
|
77
80
|
* 阈值由 `content.longRunningThreshold` 决定,**默认 0 表示不过滤**。
|
|
78
|
-
*
|
|
79
|
-
* ## 已知覆盖不到的几类(刻意保守,不做猜测)
|
|
80
|
-
*
|
|
81
|
-
* - **没有 `aniListId`**:拿不到状态,无法判定(如 `ギャビーのドールハウス`,第 131 话)。
|
|
82
|
-
* - **连 Bangumi 条目 ID 都没有**:连索引条目都取不到(如 `キラキラADらっこちゃん`,第 239 话)。
|
|
83
|
-
* - **AniList 的总话数滞后**:AniList 只跟踪到某个「季度」就停更,`episodes` 停在较小的
|
|
84
|
-
* 值而实际话数早已超过(实测 `コアラ絵日記`、`デジモンBEATBREAK` 都是 `episodes=49`
|
|
85
|
-
* 但已播到第 53 话)。曾试过「展示话数 > episodes」这条补强,但无法稳定生效
|
|
86
|
-
* (状态表在限流时可能缺项),因此不做——宁可漏剔也不误杀。
|
|
87
81
|
*/
|
|
88
82
|
private dropLongRunning;
|
|
89
83
|
/**
|
package/lib/services/digest.js
CHANGED
|
@@ -282,45 +282,28 @@ class DigestService {
|
|
|
282
282
|
* 这类作品(海螺小姐、樱桃小丸子、宝可梦 地平线、巧虎、战斗陀螺 X…)确实每周都在播,
|
|
283
283
|
* 收录它们并不算错,但很多人不把它们当作「本季新番」,任其出现会让表格变得嘈杂。
|
|
284
284
|
*
|
|
285
|
-
*
|
|
285
|
+
* 判据只有一条:**展示话数 ≥ 阈值**。长期连载番的本集数自然会涨得很高,而一季 12~24
|
|
286
|
+
* 话的当季番永远达不到阈值,因此不需要再引入别的条件。
|
|
286
287
|
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
288
|
+
* 早先这里还叠加了「AniList 未给出总话数(`episodes === null`)」作为前提,但那条实际
|
|
289
|
+
* 上没有生效:大部分条目在闸门 2 之前就被筛掉,取不到 AniList 状态,于是「有状态」
|
|
290
|
+
* 这个前提直接为假,该剔的长期番反而漏剔(实测 `キラキラADらっこちゃん` 第 239 话、
|
|
291
|
+
* `ギャビーのドールハウス` 第 131 话都因此留在表里)。去掉它之后判据不再依赖网络,
|
|
292
|
+
* 行为更可预测,也不会再被限流影响。
|
|
290
293
|
*
|
|
291
294
|
* **必须在条目构建之后调用**:`applyAiringSchedule` 内部会按作品去重,去重前后的
|
|
292
295
|
* 「第几话」可能不同。判据要落在**最终展示的话数**上。
|
|
293
296
|
*
|
|
294
297
|
* 阈值由 `content.longRunningThreshold` 决定,**默认 0 表示不过滤**。
|
|
295
|
-
*
|
|
296
|
-
* ## 已知覆盖不到的几类(刻意保守,不做猜测)
|
|
297
|
-
*
|
|
298
|
-
* - **没有 `aniListId`**:拿不到状态,无法判定(如 `ギャビーのドールハウス`,第 131 话)。
|
|
299
|
-
* - **连 Bangumi 条目 ID 都没有**:连索引条目都取不到(如 `キラキラADらっこちゃん`,第 239 话)。
|
|
300
|
-
* - **AniList 的总话数滞后**:AniList 只跟踪到某个「季度」就停更,`episodes` 停在较小的
|
|
301
|
-
* 值而实际话数早已超过(实测 `コアラ絵日記`、`デジモンBEATBREAK` 都是 `episodes=49`
|
|
302
|
-
* 但已播到第 53 话)。曾试过「展示话数 > episodes」这条补强,但无法稳定生效
|
|
303
|
-
* (状态表在限流时可能缺项),因此不做——宁可漏剔也不误杀。
|
|
304
298
|
*/
|
|
305
|
-
dropLongRunning(items
|
|
299
|
+
dropLongRunning(items) {
|
|
306
300
|
const threshold = this.config.content.longRunningThreshold;
|
|
307
301
|
if (!threshold || threshold <= 0)
|
|
308
302
|
return items;
|
|
309
|
-
// 条目只带 tid,这里按 tid 找回索引条目
|
|
310
|
-
const entryOfTid = new Map();
|
|
311
|
-
for (const candidate of candidates) {
|
|
312
|
-
const tid = defaultTidOf(candidate.entry) ?? candidate.entry.key;
|
|
313
|
-
if (!entryOfTid.has(tid))
|
|
314
|
-
entryOfTid.set(tid, candidate.entry);
|
|
315
|
-
}
|
|
316
303
|
const kept = [];
|
|
317
304
|
const dropped = [];
|
|
318
305
|
for (const item of items) {
|
|
319
|
-
|
|
320
|
-
const state = entry ? this.airingStateOf(entry, states) : undefined;
|
|
321
|
-
// 只有「AniList 明确不给总话数」才算无限连载
|
|
322
|
-
const openEnded = state !== undefined && state.episodes === null;
|
|
323
|
-
if (openEnded && item.episodeCount >= threshold) {
|
|
306
|
+
if (item.episodeCount >= threshold) {
|
|
324
307
|
if (dropped.length < 12)
|
|
325
308
|
dropped.push(`${item.name}(第${item.episodeCount}话)`);
|
|
326
309
|
continue;
|
|
@@ -328,7 +311,7 @@ class DigestService {
|
|
|
328
311
|
kept.push(item);
|
|
329
312
|
}
|
|
330
313
|
if (dropped.length) {
|
|
331
|
-
(0, utils_1.debugLog)('[digest] 剔除超长期连载番 %d
|
|
314
|
+
(0, utils_1.debugLog)('[digest] 剔除超长期连载番 %d 部(第 %d 话以上): %s', items.length - kept.length, threshold, dropped.join('、'));
|
|
332
315
|
}
|
|
333
316
|
return kept;
|
|
334
317
|
}
|
|
@@ -900,7 +883,7 @@ class DigestService {
|
|
|
900
883
|
// 「第几话」可能不是同一个值(同一部作品在窗口内有多场时,保留的那一场未必是话数最大
|
|
901
884
|
// 的那一场)。判据要落在**最终展示的话数**上,否则会出现「明明显示第 53 话却按第 49
|
|
902
885
|
// 话判定」这种错位,导致该剔的没剔掉。
|
|
903
|
-
const items = this.dropLongRunning(built
|
|
886
|
+
const items = this.dropLongRunning(built);
|
|
904
887
|
return this.finish(kind, this.headerOf(kind, window), '', groupOverride ? groupOverride(items) : this.groupOf(kind, window, items), kind === 'sub' ? this.messages.noAiringSub(subscribed.size) : this.emptyTextOf(kind));
|
|
905
888
|
}
|
|
906
889
|
/**
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -52,7 +52,7 @@ npm i koishi-plugin-anime-schedule
|
|
|
52
52
|
| `push.dailyTime` 等 | 见配置页 | 四种推送各自的开关与时刻 |
|
|
53
53
|
| `push.updateLookaheadMinutes` | `30` | 订阅作品提前多少分钟提醒 |
|
|
54
54
|
| `content.maxItems` | `0` | 单次推送最多显示多少部,`0` 为不限制 |
|
|
55
|
-
| `content.longRunningThreshold` | `0` | 剔除长期连载番的话数阈值,`0`
|
|
55
|
+
| `content.longRunningThreshold` | `0` | 剔除长期连载番的话数阈值,`0` 为不过滤。展示话数达到该值的作品不显示;填 `64` 可滤掉海螺小姐、宝可梦 地平线这类周更多年的作品 |
|
|
56
56
|
| `output.format` | `image` | `image` / `text` |
|
|
57
57
|
| `output.layout` | `table` | 图片排版:`table` / `list` |
|
|
58
58
|
| `localize.titleStyle` | `localized` | `localized` 仅中文 / `both` 中文(日文原名)/ `original` 仅日文原名 |
|