mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-13 23:16:47 +00:00
fix AutoBackup
This commit is contained in:
@@ -25,7 +25,7 @@ class AutoBackup(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "Time_machine_B.png"
|
||||
# 插件版本
|
||||
plugin_version = "1.2"
|
||||
plugin_version = "1.3"
|
||||
# 插件作者
|
||||
plugin_author = "thsrite"
|
||||
# 作者主页
|
||||
@@ -153,10 +153,14 @@ class AutoBackup(_PluginBase):
|
||||
backup_file = f"bk_{time.strftime('%Y%m%d%H%M%S')}"
|
||||
backup_path = bk_path / backup_file
|
||||
backup_path.mkdir(parents=True)
|
||||
|
||||
# 把现有的相关文件进行copy备份
|
||||
if settings.LIBRARY_CATEGORY:
|
||||
shutil.copy(f'{config_path}/category.yaml', backup_path)
|
||||
shutil.copy(f'{config_path}/user.db', backup_path)
|
||||
category_file = config_path / "category.yaml"
|
||||
if category_file.exists():
|
||||
shutil.copy(category_file, backup_path)
|
||||
userdb_file = config_path / "user.db"
|
||||
if userdb_file.exists():
|
||||
shutil.copy(userdb_file, backup_path)
|
||||
|
||||
zip_file = str(backup_path) + '.zip'
|
||||
if os.path.exists(zip_file):
|
||||
|
||||
Reference in New Issue
Block a user