fix bug
This commit is contained in:
@@ -31,7 +31,7 @@ class ChainBase(AbstractSingleton, metaclass=Singleton):
|
|||||||
self.eventmanager = EventManager()
|
self.eventmanager = EventManager()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __load_cache(filename: str) -> Any:
|
def load_cache(filename: str) -> Any:
|
||||||
"""
|
"""
|
||||||
从本地加载缓存
|
从本地加载缓存
|
||||||
"""
|
"""
|
||||||
@@ -41,7 +41,7 @@ class ChainBase(AbstractSingleton, metaclass=Singleton):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __save_cache(cache: Any, filename: str) -> None:
|
def save_cache(cache: Any, filename: str) -> None:
|
||||||
"""
|
"""
|
||||||
保存缓存到本地
|
保存缓存到本地
|
||||||
"""
|
"""
|
||||||
|
@@ -59,7 +59,7 @@ class MessageChain(ChainBase):
|
|||||||
logger.debug(f'未识别到消息内容::{body}{form}{args}')
|
logger.debug(f'未识别到消息内容::{body}{form}{args}')
|
||||||
return
|
return
|
||||||
# 加载缓存
|
# 加载缓存
|
||||||
user_cache: Dict[str, dict] = self.__load_cache(self._cache_file) or {}
|
user_cache: Dict[str, dict] = self.load_cache(self._cache_file) or {}
|
||||||
# 处理消息
|
# 处理消息
|
||||||
logger.info(f'收到用户消息内容,用户:{userid},内容:{text}')
|
logger.info(f'收到用户消息内容,用户:{userid},内容:{text}')
|
||||||
if text.startswith('/'):
|
if text.startswith('/'):
|
||||||
@@ -311,7 +311,7 @@ class MessageChain(ChainBase):
|
|||||||
items=medias[:self._page_size],
|
items=medias[:self._page_size],
|
||||||
userid=userid, total=len(medias))
|
userid=userid, total=len(medias))
|
||||||
# 保存缓存
|
# 保存缓存
|
||||||
self.__save_cache(user_cache, self._cache_file)
|
self.save_cache(user_cache, self._cache_file)
|
||||||
|
|
||||||
def __post_medias_message(self, channel: MessageChannel,
|
def __post_medias_message(self, channel: MessageChannel,
|
||||||
title: str, items: list, userid: str, total: int):
|
title: str, items: list, userid: str, total: int):
|
||||||
|
@@ -297,7 +297,7 @@ class SubscribeChain(ChainBase):
|
|||||||
刷新站点最新资源
|
刷新站点最新资源
|
||||||
"""
|
"""
|
||||||
# 读取缓存
|
# 读取缓存
|
||||||
torrents_cache: Dict[str, List[Context]] = self.__load_cache(self._cache_file) or {}
|
torrents_cache: Dict[str, List[Context]] = self.load_cache(self._cache_file) or {}
|
||||||
|
|
||||||
# 所有站点索引
|
# 所有站点索引
|
||||||
indexers = self.siteshelper.get_indexers()
|
indexers = self.siteshelper.get_indexers()
|
||||||
@@ -363,7 +363,7 @@ class SubscribeChain(ChainBase):
|
|||||||
# 从缓存中匹配订阅
|
# 从缓存中匹配订阅
|
||||||
self.__match(torrents_cache)
|
self.__match(torrents_cache)
|
||||||
# 保存缓存到本地
|
# 保存缓存到本地
|
||||||
self.__save_cache(torrents_cache, self._cache_file)
|
self.save_cache(torrents_cache, self._cache_file)
|
||||||
|
|
||||||
def __match(self, torrents_cache: Dict[str, List[Context]]):
|
def __match(self, torrents_cache: Dict[str, List[Context]]):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user