소스 검색

fix: bug修改

TIANYONG 8 달 전
부모
커밋
4743569928
1개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 8 3
      src/helpers/formateMusic.ts

+ 8 - 3
src/helpers/formateMusic.ts

@@ -689,9 +689,14 @@ export const formatXML = (xml: string, xmlUrl?: string): string => {
 		state.originAudioPlayRate = speeds[0] / state.originSpeed
 	}
 	console.log('是否是变速的曲子:',hasVaryingSpeed,speeds)
-	const hasCommon = xmlParse.querySelectorAll('part-name')?.[0]?.textContent === 'common';
-	const currentTrackIndex = hasCommon ? state.partIndex + 1 : state.partIndex;
-	const repeats: any = Array.from(xmlParse.querySelectorAll('part')?.[currentTrackIndex]?.querySelectorAll('repeat')) || [];
+	let repeats: any = [];
+	if (state.partIndex === 999) {
+		repeats = Array.from(xmlParse.querySelectorAll('repeat')) || [];
+	} else {
+		const hasCommon = xmlParse.querySelectorAll('part-name')?.[0]?.textContent === 'common';
+		const currentTrackIndex = hasCommon ? state.partIndex + 1 : state.partIndex;
+		repeats = Array.from(xmlParse.querySelectorAll('part')?.[currentTrackIndex]?.querySelectorAll('repeat')) || [];
+	}
 	compatibleXmlPitchVoice(xmlParse);
 	// 获取作词、作曲家
 	getComposer(xmlParse);