Skip to content

Commit

Permalink
feat(live): filter audios by /ok
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Jul 26, 2021
1 parent 0ffcb82 commit 8782afa
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions app/src/ts/renderer/mishiro-live.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,19 +526,35 @@ export default class extends Vue {
if (this.queryString) {
if (this.currentAudioType === 'BGM') {
const arr = []
const re = new RegExp(this.queryString)
for (let i = 0; i < this.bgmManifest.length; i++) {
if (re.test(this.bgmManifest[i].fileName)) {
arr.push(this.bgmManifest[i])
if (this.queryString === '/ok') {
for (let i = 0; i < this.bgmManifest.length; i++) {
if (this.bgmManifest[i]._canplay) {
arr.push(this.bgmManifest[i])
}
}
} else {
const re = new RegExp(this.queryString)
for (let i = 0; i < this.bgmManifest.length; i++) {
if (re.test(this.bgmManifest[i].fileName)) {
arr.push(this.bgmManifest[i])
}
}
}
setAudioList(arr)
} else if (this.currentAudioType === 'LIVE') {
const arr = []
const re = new RegExp(this.queryString)
for (let i = 0; i < this.liveManifest.length; i++) {
if (re.test(this.liveManifest[i].fileName)) {
arr.push(this.liveManifest[i])
if (this.queryString === '/ok') {
for (let i = 0; i < this.liveManifest.length; i++) {
if (this.liveManifest[i]._canplay) {
arr.push(this.liveManifest[i])
}
}
} else {
const re = new RegExp(this.queryString)
for (let i = 0; i < this.liveManifest.length; i++) {
if (re.test(this.liveManifest[i].fileName)) {
arr.push(this.liveManifest[i])
}
}
}
setAudioList(arr)
Expand Down

0 comments on commit 8782afa

Please sign in to comment.