fix 远程搜索选择序号问题

This commit is contained in:
jxxghp 2023-10-28 11:25:24 +08:00
parent 61e7ec9a36
commit e2213e1ef6

View File

@ -87,13 +87,15 @@ class MessageChain(ChainBase):
# 发送消息 # 发送消息
self.post_message(Notification(channel=channel, title="输入有误!", userid=userid)) self.post_message(Notification(channel=channel, title="输入有误!", userid=userid))
return return
# 选择的序号
_choice = int(text) + _current_page * self._page_size - 1
# 缓存类型 # 缓存类型
cache_type: str = cache_data.get('type') cache_type: str = cache_data.get('type')
# 缓存列表 # 缓存列表
cache_list: list = cache_data.get('items') cache_list: list = copy.deepcopy(cache_data.get('items'))
# 选择 # 选择
if cache_type == "Search": if cache_type == "Search":
mediainfo: MediaInfo = cache_list[int(text) + _current_page * self._page_size - 1] mediainfo: MediaInfo = cache_list[_choice]
_current_media = mediainfo _current_media = mediainfo
# 查询缺失的媒体信息 # 查询缺失的媒体信息
exist_flag, no_exists = self.downloadchain.get_no_exists_info(meta=_current_meta, exist_flag, no_exists = self.downloadchain.get_no_exists_info(meta=_current_meta,
@ -158,7 +160,7 @@ class MessageChain(ChainBase):
elif cache_type == "Subscribe": elif cache_type == "Subscribe":
# 订阅媒体 # 订阅媒体
mediainfo: MediaInfo = cache_list[int(text) - 1] mediainfo: MediaInfo = cache_list[_choice]
# 查询缺失的媒体信息 # 查询缺失的媒体信息
exist_flag, _ = self.downloadchain.get_no_exists_info(meta=_current_meta, exist_flag, _ = self.downloadchain.get_no_exists_info(meta=_current_meta,
mediainfo=mediainfo) mediainfo=mediainfo)
@ -187,7 +189,7 @@ class MessageChain(ChainBase):
username=username) username=username)
else: else:
# 下载种子 # 下载种子
context: Context = cache_list[int(text) - 1] context: Context = cache_list[_choice]
# 下载 # 下载
self.downloadchain.download_single(context, userid=userid, channel=channel, username=username) self.downloadchain.download_single(context, userid=userid, channel=channel, username=username)