- 新增自定义域名

- 增加连接报错域名提示 #195
- 修复 Dev-debug 开启的错误 #192
- 重做重命名逻辑,支持合集重命名以及文件夹内重命名,支持字幕重命名。
- Fix pytest
This commit is contained in:
EstrellaXD
2023-04-23 21:47:08 +08:00
parent ee8f7dd1a2
commit 9fd9dadbc1
2 changed files with 20 additions and 9 deletions

View File

@@ -52,10 +52,21 @@ def env_to_config() -> Config:
if os.path.isdir("config") and VERSION == "DEV_VERSION":
CONFIG_PATH = "config/config_dev.json"
settings = load_config_from_file(CONFIG_PATH)
print(dict(settings))
if os.path.isfile(CONFIG_PATH):
settings = load_config_from_file(CONFIG_PATH)
else:
settings = env_to_config()
save_config_to_file(settings, CONFIG_PATH)
elif os.path.isdir("config") and VERSION != "DEV_VERSION":
CONFIG_PATH = "config/config.json"
if os.path.isfile(CONFIG_PATH):
settings = load_config_from_file(CONFIG_PATH)
else:
settings = env_to_config()
save_config_to_file(settings, CONFIG_PATH)
else:
settings = Config()

View File

@@ -60,10 +60,10 @@ class Notification(BaseModel):
class Config(BaseModel):
data_version: float = Field(4.0, description="Data version")
program: Program
downloader: Downloader
rss_parser: RSSParser
bangumi_manage: BangumiManage
debug: Debug
proxy: Proxy
notification: Notification
program: Program = Program()
downloader: Downloader = Downloader()
rss_parser: RSSParser = RSSParser()
bangumi_manage: BangumiManage = BangumiManage()
debug: Debug = Debug()
proxy: Proxy = Proxy()
notification: Notification = Notification()