fix: 解析自建谱文件出现文件名为0的问题

This commit is contained in:
Xu Zhimeng 2024-08-07 09:43:07 +08:00
parent 12cdef2ae1
commit 79f47eacb6

View File

@ -201,7 +201,7 @@ export class PHDParser {
getFilePrefixes(text) {
const unHandledfilePrefixes = this.splitLineText(text)
const filePrefixes = unHandledfilePrefixes
.filter(filePrefix => filePrefix)
.filter(filePrefix => filePrefix && filePrefix !== '0')
.map(filePrefix => {
filePrefix = filePrefix.replace(/(\d{4})\/(\d{2})\/(\d{2})-(\d{2}):(\d{2})(:\d{2}\.\d)?/, '$1$2$3_$4$5')
return filePrefix + '_'