From 02d9987ad7c3baf32167bb5b04c3e643fa95b2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Thu, 26 Sep 2024 07:32:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dwindows=E4=B8=8B?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaomusic/xiaomusic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xiaomusic/xiaomusic.py b/xiaomusic/xiaomusic.py index 611cb30..b181f11 100644 --- a/xiaomusic/xiaomusic.py +++ b/xiaomusic/xiaomusic.py @@ -433,9 +433,9 @@ class XiaoMusic: tags = copy.copy(self.all_music_tags.get(name, asdict(Metadata()))) picture = tags["picture"] if picture: - picture = picture.replace("\\", "/") if picture.startswith(self.config.picture_cache_path): picture = picture[len(self.config.picture_cache_path) :] + picture = picture.replace("\\", "/") if picture.startswith("/"): picture = picture[1:] encoded_name = urllib.parse.quote(picture) @@ -473,9 +473,9 @@ class XiaoMusic: self.log.warning(f"Failed to convert file to MP3 format: {filename}") # 构造音乐文件的URL - filename = filename.replace("\\", "/") if filename.startswith(self.config.music_path): filename = filename[len(self.config.music_path) :] + filename = filename.replace("\\", "/") if filename.startswith("/"): filename = filename[1:]