fix 增加对MoviePilot V2 版本 SQLite WAL模式的支持"

This commit is contained in:
thsrite
2024-11-16 16:57:44 +08:00
parent 7ebc136a90
commit 4aa74b7a7e
2 changed files with 9 additions and 6 deletions

View File

@@ -350,12 +350,12 @@
"name": "自动备份",
"description": "自动备份数据和配置文件。",
"labels": "系统设置",
"version": "2.0.2",
"version": "2.0.3",
"icon": "Time_machine_B.png",
"author": "thsrite",
"level": 1,
"history": {
"v2.0.2": "增加对MoviePilot V2 版本 SQLite WAL模式的支持",
"v2.0.3": "增加对MoviePilot V2 版本 SQLite WAL模式的支持",
"v2.0.1": "修复cookies文件夹备份失败",
"v2.0": "支持备份app.env及cookies,支持自定义保存路径",
"v1.3": "去除已废弃的环境变量引用",

View File

@@ -25,7 +25,7 @@ class AutoBackup(_PluginBase):
# 插件图标
plugin_icon = "Time_machine_B.png"
# 插件版本
plugin_version = "2.0.2"
plugin_version = "2.0.3"
# 插件作者
plugin_author = "thsrite"
# 作者主页
@@ -161,9 +161,12 @@ class AutoBackup(_PluginBase):
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)
# 查找所有以 "user.db" 开头的文件
userdb_files = list(config_path.glob("user.db*"))
# 如果找到了任何匹配的文件,则进行复制
for userdb_file in userdb_files:
if userdb_file.exists():
shutil.copy(userdb_file, backup_path)
app_file = config_path / "app.env"
if app_file.exists():
shutil.copy(app_file, backup_path)