diff --git a/package.json b/package.json index ba0502a..40536e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "touhou-tagger", - "version": "1.11.0", + "version": "1.11.1", "description": "从 THBWiki 自动填写东方 Project CD 曲目信息.", "main": "dist/core/index.js", "bin": { diff --git a/src/core/metadata/thb-wiki/thb-wiki.ts b/src/core/metadata/thb-wiki/thb-wiki.ts index 2ef2f0b..60e084d 100644 --- a/src/core/metadata/thb-wiki/thb-wiki.ts +++ b/src/core/metadata/thb-wiki/thb-wiki.ts @@ -135,6 +135,10 @@ export class ThbWiki extends MetadataSource { } } } + const isSequence = (data: Element) => { + return [...data.childNodes].some(node => isNodeAnElement(node, 'br')) + } + const label = trackInfoRow.querySelector('.label').textContent.trim() const rawData = trackInfoRow.querySelector('.text') as HTMLElement const actions: { [infoName: string]: (data: HTMLElement) => TrackParseInfo } = { @@ -151,6 +155,9 @@ export class ThbWiki extends MetadataSource { 作词: defaultInfoParser('lyricists'), 配音: data => { const name = 'voices' + if (!isSequence(data)) { + return defaultInfoParser(name)(data) + } const slices = splitChildNodesByBr(data) const rows = slices.flatMap(it => { const anchors = it.filter((a): a is HTMLAnchorElement => isNodeAnElement(a, 'a')) @@ -177,6 +184,9 @@ export class ThbWiki extends MetadataSource { }, 演奏: data => { const name = 'instruments' + if (!isSequence(data)) { + return defaultInfoParser(name)(data) + } const slices = splitChildNodesByBr(data) const rows = slices .map(it => {