mirror of
https://github.com/hanxi/xiaomusic.git
synced 2025-12-05 14:42:50 +08:00
fix: 修复下载歌单重命名问题
This commit is contained in:
@@ -2,7 +2,7 @@ import re
|
|||||||
|
|
||||||
|
|
||||||
def removepre(filename):
|
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
|
new_filename = filename
|
||||||
if match:
|
if match:
|
||||||
num = match.group(1)
|
num = match.group(1)
|
||||||
@@ -26,4 +26,4 @@ if __name__ == "__main__":
|
|||||||
removepre(" 18 色风车.mp3")
|
removepre(" 18 色风车.mp3")
|
||||||
removepre(" 18 18 你好.mp3")
|
removepre(" 18 18 你好.mp3")
|
||||||
removepre(" 18 18 我好.mp3")
|
removepre(" 18 18 我好.mp3")
|
||||||
removepre("09 009. 梁静茹-亲亲.mp3")
|
removepre("p09 009. 梁静茹-亲亲.mp3")
|
||||||
|
|||||||
@@ -983,7 +983,7 @@ def remove_common_prefix(directory):
|
|||||||
|
|
||||||
log.info(f'Common prefix identified: "{common_prefix}"')
|
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:
|
for filename in files:
|
||||||
if filename == common_prefix:
|
if filename == common_prefix:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user