优化整理代码效率、减少额外递归

This commit is contained in:
景大侠
2026-01-20 14:38:41 +08:00
parent 71caad0655
commit 16bd71a6cb
4 changed files with 35 additions and 51 deletions
+4 -4
View File
@@ -151,10 +151,10 @@ class StorageChain(ChainBase):
判断是否包含蓝光必备的文件夹
"""
required_files = ("BDMV", "CERTIFICATE")
for item in fileitems or []:
if item.type == "dir" and item.name in required_files:
return True
return False
return any(
item.type == "dir" and item.name in required_files
for item in fileitems or []
)
def delete_media_file(self, fileitem: schemas.FileItem, delete_self: bool = True) -> bool:
"""