diff --git a/update-static-version.py b/update-static-version.py index 4486cab..c2f9f6c 100755 --- a/update-static-version.py +++ b/update-static-version.py @@ -22,7 +22,7 @@ def update_html_version(html_files, version): :param version: 新的版本号字符串。 """ pattern = re.compile(r'(/static/.*(css|js))\?version=[^"]*"') - #pattern = re.compile(r'(/static/.*html)\?version=[^"]*"') + # pattern = re.compile(r'(/static/.*html)\?version=[^"]*"') for html_file in html_files: if not html_file.exists(): @@ -32,8 +32,8 @@ def update_html_version(html_files, version): html_content = html_file.read_text() # 更新CSS和JS版本号 - html_content = pattern.sub(fr'\g<1>?version={version}"', html_content) - #html_content = pattern.sub(fr'\g<1>"', html_content) + html_content = pattern.sub(rf'\g<1>?version={version}"', html_content) + # html_content = pattern.sub(fr'\g<1>"', html_content) # 保存更改到HTML文件 html_file.write_text(html_content) diff --git a/xiaomusic/xiaomusic.py b/xiaomusic/xiaomusic.py index 68a1700..3b9dc15 100644 --- a/xiaomusic/xiaomusic.py +++ b/xiaomusic/xiaomusic.py @@ -87,6 +87,9 @@ class XiaoMusic: def init_config(self): self.music_path = self.config.music_path self.conf_path = self.config.conf_path + # 兼容旧配置空的情况 + if not self.conf_path: + self.conf_path = "conf" self.download_path = self.config.download_path if not self.download_path: self.download_path = self.music_path