From fb44f88df2cc87b23e1dd058278ae074d0b0ece5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Wed, 17 Jul 2024 02:20:02 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E6=97=A7=E7=9A=84sett?= =?UTF-8?q?ing.json=E6=96=87=E4=BB=B6=E4=B8=ADconf=5Fpath=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update-static-version.py | 6 +++--- xiaomusic/xiaomusic.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) 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