优化Tencent源搜索,补充国粤多语言版本场景下返回多版本
This commit is contained in:
1 parent
c8b42221aa
commit
42ae6b8a61
2 files changed
+26
-1
No files matched your search
@@ -13,7 +13,7 @@ export const Globals = {
|
||||
accessedEnvVars: {},
|
||||
|
||||
// 静态常量
|
||||
VERSION: '1.17.4',
|
||||
VERSION: '1.17.5',
|
||||
MAX_LOGS: 1000, // 日志存储,最多保存 1000 行
|
||||
MAX_ANIMES: 100,
|
||||
MAX_RECORDS: 100, // 请求记录最大数量
|
||||
|
||||
@@ -157,6 +157,31 @@ export default class TencentSource extends BaseSource {
|
||||
itemList = data.data.normalList.itemList;
|
||||
}
|
||||
|
||||
// 追加「相关影视」box 中 title 包含 keyword 的 itemList
|
||||
if (data.data && data.data.areaBoxList) {
|
||||
for (const box of data.data.areaBoxList) {
|
||||
if (
|
||||
box.itemList &&
|
||||
box.boxTitle &&
|
||||
Array.isArray(box.boxTitle.boxTitles) &&
|
||||
box.boxTitle.boxTitles.includes("相关影视")
|
||||
) {
|
||||
const relatedItems = box.itemList.filter(item =>
|
||||
item.videoInfo &&
|
||||
item.videoInfo.title &&
|
||||
item.videoInfo.title.includes(keyword)
|
||||
);
|
||||
if (relatedItems.length > 0) {
|
||||
log("info", `[Tencent] 追加「相关影视」box 中匹配 "${keyword}" 的 ${relatedItems.length} 个项目`);
|
||||
itemList = [...itemList, ...relatedItems];
|
||||
} else {
|
||||
log("info", `[Tencent] 「相关影视」box 中无匹配 "${keyword}" 的项目`);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (itemList.length === 0) {
|
||||
log("info", "[Tencent] 搜索无结果");
|
||||
return [];
|
||||
|
||||
Reference in new issue
Block a user