style: lint
This commit is contained in:
@@ -120,7 +120,7 @@ export default function Home() {
|
||||
const list = navigationList.filter((item) => {
|
||||
return (
|
||||
item.name.toLowerCase().indexOf(searchField.toLowerCase()) !==
|
||||
-1 || item.type === 'date'
|
||||
-1 || item.type === 'date'
|
||||
)
|
||||
})
|
||||
const newList = []
|
||||
@@ -222,7 +222,7 @@ export default function Home() {
|
||||
}
|
||||
viewBox={
|
||||
entry.type ===
|
||||
'operator'
|
||||
'operator'
|
||||
? '0 0 88.969 71.469'
|
||||
: '0 0 94.563 67.437'
|
||||
}
|
||||
@@ -234,24 +234,25 @@ export default function Home() {
|
||||
}
|
||||
>
|
||||
{language ===
|
||||
'zh-CN'
|
||||
'zh-CN'
|
||||
? entry.type ===
|
||||
'skin'
|
||||
? `${entry
|
||||
.skinName[
|
||||
'zh-CN'
|
||||
]
|
||||
} · ${entry.operatorName}`
|
||||
'skin'
|
||||
? `${
|
||||
entry
|
||||
.skinName[
|
||||
'zh-CN'
|
||||
]
|
||||
} · ${entry.operatorName}`
|
||||
: entry.operatorName
|
||||
: entry
|
||||
.skinName[
|
||||
'en-US'
|
||||
]}
|
||||
.skinName[
|
||||
'en-US'
|
||||
]}
|
||||
</section>
|
||||
<section
|
||||
className={
|
||||
classes[
|
||||
'arrow-icon'
|
||||
'arrow-icon'
|
||||
]
|
||||
}
|
||||
>
|
||||
@@ -368,9 +369,9 @@ function OperatorElement({ item, hidden, handleVoicePlay }) {
|
||||
<span className={classes.text}>
|
||||
{
|
||||
item.codename[
|
||||
language.startsWith('en')
|
||||
? alternateLang
|
||||
: textDefaultLang
|
||||
language.startsWith('en')
|
||||
? alternateLang
|
||||
: textDefaultLang
|
||||
]
|
||||
}
|
||||
</span>
|
||||
|
||||
@@ -95,7 +95,8 @@ export default class Voice {
|
||||
this.#default.language.voice = this.#voice.languages[0]
|
||||
this.#config.language = this.#default.language.voice
|
||||
this.#voice.locations = this.#getVoiceLocations()
|
||||
this.#voice.list = this.#charwordTable.availability[this.#config.language]
|
||||
this.#voice.list =
|
||||
this.#charwordTable.availability[this.#config.language]
|
||||
}
|
||||
|
||||
success() {
|
||||
@@ -206,7 +207,7 @@ export default class Voice {
|
||||
const content = subtitle.text
|
||||
const cvInfo =
|
||||
this.#charwordTable.voiceLangs[this.subtitleLanguage][
|
||||
this.#config.language
|
||||
this.#config.language
|
||||
]
|
||||
document.getElementById('voice-title').innerText = title
|
||||
document.getElementById('voice-subtitle').innerText = content
|
||||
@@ -251,7 +252,10 @@ export default class Voice {
|
||||
|
||||
#nextVoice() {
|
||||
const getVoiceId = () => {
|
||||
const id = this.#voice.list[Math.floor(Math.random() * this.#voice.list.length)]
|
||||
const id =
|
||||
this.#voice.list[
|
||||
Math.floor(Math.random() * this.#voice.list.length)
|
||||
]
|
||||
return id === this.#voice.id.last ? getVoiceId() : id
|
||||
}
|
||||
this.#playVoice(getVoiceId())
|
||||
@@ -355,7 +359,8 @@ export default class Voice {
|
||||
this.#voice.list = this.#charwordTable.availability[lang]
|
||||
} else {
|
||||
this.#config.language = this.#default.language.voice
|
||||
this.#voice.list = this.#charwordTable.availability[this.#config.language]
|
||||
this.#voice.list =
|
||||
this.#charwordTable.availability[this.#config.language]
|
||||
}
|
||||
const availableSubtitleLang = this.#getSubtitleLanguages()
|
||||
if (!availableSubtitleLang.includes(this.#config.subtitle.language)) {
|
||||
|
||||
@@ -58,7 +58,7 @@ const generateMapping = () => {
|
||||
})
|
||||
let noCheck = false
|
||||
if (mode === 'update' || mode === 'download') {
|
||||
noCheck = true
|
||||
noCheck = true
|
||||
}
|
||||
const musicFolder = DATA_DIR
|
||||
const musicTableContent = file.readSync(MUSIC_TABLE_JSON)
|
||||
@@ -97,22 +97,22 @@ const generateMapping = () => {
|
||||
}
|
||||
|
||||
if (!noCheck) {
|
||||
for (const e of musicFiles) {
|
||||
const musicPath = path.join(e.source, e.filename)
|
||||
if (!file.exists(musicPath)) {
|
||||
throw new Error(
|
||||
`Music file ${e.filename} is not found in music folder.`
|
||||
)
|
||||
}
|
||||
}
|
||||
for (const e of musicFiles) {
|
||||
const musicPath = path.join(e.source, e.filename)
|
||||
if (!file.exists(musicPath)) {
|
||||
throw new Error(
|
||||
`Music file ${e.filename} is not found in music folder.`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for (const e of Object.keys(musicFileMapping)) {
|
||||
if (!backgroundFiles.includes(e)) {
|
||||
throw new Error(
|
||||
`Background file ${e} is not found in background folder.`
|
||||
)
|
||||
}
|
||||
}
|
||||
for (const e of Object.keys(musicFileMapping)) {
|
||||
if (!backgroundFiles.includes(e)) {
|
||||
throw new Error(
|
||||
`Background file ${e} is not found in background folder.`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -130,7 +130,7 @@ export const update = async () => {
|
||||
const musicBankAlias = audioDataTable.bankAlias
|
||||
const musicData: MusicDataItem[] =
|
||||
metaTable.homeBackgroundData.homeBgDataList.reduce((acc, cur) => {
|
||||
cur.multiFormList.forEach(item => {
|
||||
cur.multiFormList.forEach((item) => {
|
||||
acc.push({
|
||||
id: item.multiFormBgId,
|
||||
musicId: item.bgMusicId,
|
||||
|
||||
Reference in New Issue
Block a user