Skip to content

Commit 8782afa

Browse files
committed
feat(live): filter audios by /ok
1 parent 0ffcb82 commit 8782afa

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

app/src/ts/renderer/mishiro-live.ts

+24-8
Original file line numberDiff line numberDiff line change
@@ -526,19 +526,35 @@ export default class extends Vue {
526526
if (this.queryString) {
527527
if (this.currentAudioType === 'BGM') {
528528
const arr = []
529-
const re = new RegExp(this.queryString)
530-
for (let i = 0; i < this.bgmManifest.length; i++) {
531-
if (re.test(this.bgmManifest[i].fileName)) {
532-
arr.push(this.bgmManifest[i])
529+
if (this.queryString === '/ok') {
530+
for (let i = 0; i < this.bgmManifest.length; i++) {
531+
if (this.bgmManifest[i]._canplay) {
532+
arr.push(this.bgmManifest[i])
533+
}
534+
}
535+
} else {
536+
const re = new RegExp(this.queryString)
537+
for (let i = 0; i < this.bgmManifest.length; i++) {
538+
if (re.test(this.bgmManifest[i].fileName)) {
539+
arr.push(this.bgmManifest[i])
540+
}
533541
}
534542
}
535543
setAudioList(arr)
536544
} else if (this.currentAudioType === 'LIVE') {
537545
const arr = []
538-
const re = new RegExp(this.queryString)
539-
for (let i = 0; i < this.liveManifest.length; i++) {
540-
if (re.test(this.liveManifest[i].fileName)) {
541-
arr.push(this.liveManifest[i])
546+
if (this.queryString === '/ok') {
547+
for (let i = 0; i < this.liveManifest.length; i++) {
548+
if (this.liveManifest[i]._canplay) {
549+
arr.push(this.liveManifest[i])
550+
}
551+
}
552+
} else {
553+
const re = new RegExp(this.queryString)
554+
for (let i = 0; i < this.liveManifest.length; i++) {
555+
if (re.test(this.liveManifest[i].fileName)) {
556+
arr.push(this.liveManifest[i])
557+
}
542558
}
543559
}
544560
setAudioList(arr)

0 commit comments

Comments
 (0)