feat(bilibili): 删除重复的竖屏模式入口 (#691)

Closes blackmatrix7/ios_rule_script#668
This commit is contained in:
chouchoui 2022-08-29 15:13:43 +08:00 committed by blackmatrix7
parent 28bdd904d3
commit d9dc2d06f4

View File

@ -84,31 +84,21 @@ const enableMall = Boolean(magicJS.read(bilibili_enable_mall));
// 545 首页追番tab442 开始为概念版id 适配港澳台代理模式
const tabList = new Set([39, 40, 41, 545, 151, 442, 99, 100, 101, 554, 556]);
// 尝试使用tab name直观修改
const tabNameList = new Set(["直播", "推荐", "热门", "动画", "影视"]);
// 107 概念版游戏中心获取修改为Story模式
const topList = new Set([176, 222, 107]);
const tabNameList = new Set(["直播", "推荐", "热门", "动画", "追番", "影视"]);
// 222 游戏中心 107 概念版游戏中心
// 176 消息中心
const topList = new Set([176]);
// 102 开始为概念版id
const bottomList = new Set([177, 178, 179, 181, 102, 103, 104, 105, 106]);
let obj = JSON.parse(magicJS.response.body);
if (obj["data"]["tab"]) {
let tab = obj["data"]["tab"].filter((e) => {
return tabNameList.has(e.name);
return tabNameList.has(e.name) || tabList.has(e.id);
});
obj["data"]["tab"] = tab;
}
// 将 id222 & 107调整为Story功能按钮
let storyAid = magicJS.read(storyAidKey);
if (!storyAid) {
storyAid = "246834163";
}
if (obj["data"]["top"]) {
let top = obj["data"]["top"].filter((e) => {
if (e.id === 222 || e.id === 107) {
e.uri = `bilibili://story/${storyAid}`;
e.icon = "https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/bilibili/bilibili_icon.png";
e.tab_id = "Story_Top";
e.name = "Story";
}
return topList.has(e.id);
});
obj["data"]["top"] = top;