Skip to content

Commit

Permalink
交互菜单增加订阅搜索、清理缓存
Browse files Browse the repository at this point in the history
  • Loading branch information
thsrite committed Feb 11, 2023
1 parent 0d6798c commit 2322a67
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ https://spk7.imnks.com/
**一级菜单及一级菜单下的前几个子菜单顺序需要一模一样**,在符合截图的示例项后可以自己增加别的二级菜单项。
![image](https://user-images.githubusercontent.com/54088512/217709966-3d73d983-8eff-42d0-a132-b5ef943c3b87.png)
![image](https://user-images.githubusercontent.com/54088512/218261870-ed15b6b6-895f-45e4-913c-4dda75144a9a.png)
2) **Telegram Bot机器人**
Expand All @@ -194,16 +194,19 @@ https://spk7.imnks.com/
**命令与功能对应关系**
| 命令 | 功能 |
| ---- | ---- |
| /rss | RSS订阅 |
| /ptt | 下载文件转移 |
| /ptr | 删种 |
| /pts | 站点签到 |
| /udt | 系统更新 |
| /rst | 目录同步 |
| /db | 豆瓣想看 |
| /utf | 重新识别 |
| 命令 | 功能 |
|---------| ---- |
| /rss | RSS订阅 |
| /ssa | 订阅搜索 |
| /ptt | 下载文件转移 |
| /ptr | 自动删种 |
| /pts | 站点签到 |
| /udt | 系统更新 |
| /tbl | 清理转移缓存 |
| /trh | 清理RSS缓存 |
| /rst | 目录同步 |
| /db | 豆瓣想看 |
| /utf | 重新识别 |
4) **Synology Chat**
Expand Down
8 changes: 6 additions & 2 deletions app/conf/moduleconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@
class ModuleConf(object):
# 菜单对应关系,配置WeChat应用中配置的菜单ID与执行命令的对应关系,需要手工修改
# 菜单序号在https://work.weixin.qq.com/wework_admin/frame#apps 应用自定义菜单中维护,然后看日志输出的菜单序号是啥(按顺利能猜到的)....
# 命令对应关系:/ptt 下载文件转移;/ptr 删种;/pts 站点签到;/rst 目录同步;/rst 豆瓣想看;/utf 重新识别;/rss RSS下载;/udt 系统更新
# 命令对应关系:/ptt 下载文件转移;/ptr 删种;/pts 站点签到;/rst 目录同步;/rst 豆瓣想看;/utf 重新识别;
# /ssa 订阅搜索;/tbl 清理转移缓存;/trh 清理RSS缓存;/rss RSS下载;/udt 系统更新
WECHAT_MENU = {
'_0_0': '/ptt',
'_0_1': '/ptr',
'_0_2': '/rss',
'_0_3': '/ssa',
'_1_0': '/rst',
'_1_1': '/db',
'_1_2': '/utf',
'_2_0': '/pts',
'_2_1': '/udt'
'_2_1': '/udt',
'_2_2': '/tbl',
'_2_3': '/trh'
}

# 全量转移模式
Expand Down
11 changes: 7 additions & 4 deletions web/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def __init__(self):
"tv_calendar_data": self.__tv_calendar_data,
"modify_tmdb_cache": self.__modify_tmdb_cache,
"rss_detail": self.__rss_detail,
"truncate_blacklist": self.__truncate_blacklist,
"truncate_rsshistory": self.__truncate_rsshistory,
"truncate_blacklist": self.truncate_blacklist,
"truncate_rsshistory": self.truncate_rsshistory,
"add_brushtask": self.__add_brushtask,
"del_brushtask": self.__del_brushtask,
"brushtask_detail": self.__brushtask_detail,
Expand Down Expand Up @@ -277,6 +277,9 @@ def handle_message_job(msg, in_from=SearchType.OT, user_id=None, user_name=None)
"/rst": {"func": Sync().transfer_all_sync, "desp": "目录同步"},
"/rss": {"func": Rss().rssdownload, "desp": "RSS订阅"},
"/db": {"func": DoubanSync().sync, "desp": "豆瓣同步"},
"/ssa": {"func": Subscribe().subscribe_search_all, "desp": "订阅搜索"},
"/tbl": {"func": WebAction().truncate_blacklist, "desp": "清理转移缓存"},
"/trh": {"func": WebAction().truncate_rsshistory, "desp": "清理RSS缓存"},
"/utf": {"func": WebAction().unidentification, "desp": "重新识别"},
"/udt": {"func": WebAction().update_system, "desp": "系统更新"}
}
Expand Down Expand Up @@ -1884,14 +1887,14 @@ def __modify_tmdb_cache(data):
MetaHelper().save_meta_data(force=True)
return {"code": 0}

def __truncate_blacklist(self, data):
def truncate_blacklist(self, data):
"""
清空文件转移黑名单记录
"""
self.dbhelper.truncate_transfer_blacklist()
return {"code": 0}

def __truncate_rsshistory(self, data):
def truncate_rsshistory(self, data):
"""
清空RSS历史记录
"""
Expand Down

0 comments on commit 2322a67

Please sign in to comment.