1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2025-12-06 14:52:50 +08:00

fix: 修复下载歌单重命名问题

This commit is contained in:
涵曦
2025-01-17 20:01:09 +08:00
parent 696aaf06b3
commit 43d657dd6f
2 changed files with 3 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ import re
def removepre(filename):
match = re.search(r"^(\d+)\s+\d*(.+?)\.(.*$)", filename.strip())
match = re.search(r"^[pP]?(\d+)\s+\d*(.+?)\.(.*$)", filename.strip())
new_filename = filename
if match:
num = match.group(1)
@@ -26,4 +26,4 @@ if __name__ == "__main__":
removepre(" 18 色风车.mp3")
removepre(" 18 18 你好.mp3")
removepre(" 18 18 我好.mp3")
removepre("09 009. 梁静茹-亲亲.mp3")
removepre("p09 009. 梁静茹-亲亲.mp3")

View File

@@ -983,7 +983,7 @@ def remove_common_prefix(directory):
log.info(f'Common prefix identified: "{common_prefix}"')
pattern = re.compile(r"^(\d+)\s+\d*(.+?)\.(.*$)")
pattern = re.compile(r"^[pP]?(\d+)\s+\d*(.+?)\.(.*$)")
for filename in files:
if filename == common_prefix:
continue