feat: 命令默认不覆盖现有内容,更新文档

This commit is contained in:
amtoaer
2023-12-06 01:19:08 +08:00
parent 1686c1a8df
commit 9d151b4731
3 changed files with 29 additions and 8 deletions

View File

@@ -47,12 +47,15 @@ async def _refresh_favorite_item_info(
process_nfo: bool = False,
process_upper: bool = False,
process_subtitle: bool = False,
force: bool = False,
):
items = await FavoriteItem.filter(downloaded=True).prefetch_related("upper")
await asyncio.gather(
*[aremove(path) for item in items for path in path_getter(item)],
return_exceptions=True,
)
if force:
# 如果强制刷新,那么就先把现存的所有内容删除
await asyncio.gather(
*[aremove(path) for item in items for path in path_getter(item)],
return_exceptions=True,
)
await asyncio.gather(
*[
process_favorite_item(