修复音乐名称和歌手信息格式化(#2733)

This commit is contained in:
lyswhut
2026-04-23 18:08:44 +08:00
parent 2cf84a796d
commit ba8a6bf76c
8 changed files with 17 additions and 10 deletions
+4
View File
@@ -148,3 +148,7 @@ export const clipFileNameLength = (name: string) => {
return name.length > MAX_FILE_NAME_LENGTH ? name.substring(0, MAX_FILE_NAME_LENGTH) : name
}
export const formatMusicName = (format: string, name: string, singer: string) => {
// return format.replace(/歌名|歌手/g, match => match === '歌名' ? name : singer)
return format.replace('歌手', singer).replace('歌名', name)
}