mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
fix 获取上次搜索结果时产生的NoneType异常
glitchtip#14
This commit is contained in:
@@ -20,7 +20,7 @@ async def search_latest(_: schemas.TokenPayload = Depends(verify_token)) -> Any:
|
|||||||
"""
|
"""
|
||||||
查询搜索结果
|
查询搜索结果
|
||||||
"""
|
"""
|
||||||
torrents = await SearchChain().async_last_search_results()
|
torrents = await SearchChain().async_last_search_results() or []
|
||||||
return [torrent.to_dict() for torrent in torrents]
|
return [torrent.to_dict() for torrent in torrents]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -86,13 +86,13 @@ class SearchChain(ChainBase):
|
|||||||
self.save_cache(contexts, self.__result_temp_file)
|
self.save_cache(contexts, self.__result_temp_file)
|
||||||
return contexts
|
return contexts
|
||||||
|
|
||||||
def last_search_results(self) -> List[Context]:
|
def last_search_results(self) -> Optional[List[Context]]:
|
||||||
"""
|
"""
|
||||||
获取上次搜索结果
|
获取上次搜索结果
|
||||||
"""
|
"""
|
||||||
return self.load_cache(self.__result_temp_file)
|
return self.load_cache(self.__result_temp_file)
|
||||||
|
|
||||||
async def async_last_search_results(self) -> List[Context]:
|
async def async_last_search_results(self) -> Optional[List[Context]]:
|
||||||
"""
|
"""
|
||||||
异步获取上次搜索结果
|
异步获取上次搜索结果
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user