mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-29 12:06:51 +08:00
fix(plugins): preserve top-level hidden restore entries (#6378)
This commit is contained in:
+6
-1
@@ -165,7 +165,7 @@ class SystemChain(ChainBase):
|
||||
for item in backup_dir.iterdir():
|
||||
if (
|
||||
item.name == SystemChain._plugin_restore_pending_file
|
||||
or item.name.startswith(".")
|
||||
or SystemChain.__is_snapshot_artifact(item.name)
|
||||
):
|
||||
continue
|
||||
target_path = plugins_dir / item.name
|
||||
@@ -205,6 +205,11 @@ class SystemChain(ChainBase):
|
||||
if backup_dir.exists():
|
||||
SystemChain.__write_plugin_restore_pending(pending_file, {})
|
||||
|
||||
@staticmethod
|
||||
def __is_snapshot_artifact(name: str) -> bool:
|
||||
"""识别快照替换过程中生成的临时或旧快照条目。"""
|
||||
return bool(re.fullmatch(r"\..+\.(?:tmp|old)-[0-9a-f]{32}", name))
|
||||
|
||||
@staticmethod
|
||||
def __read_plugin_restore_pending(pending_file: Path) -> Optional[dict[str, bool]]:
|
||||
"""读取仍需恢复的插件项目;无效内容按全部项目重试。"""
|
||||
|
||||
Reference in New Issue
Block a user