fix: video preview click next or prev button subtitles not update (#2423)

This commit is contained in:
ULiiAn 2023-05-01 19:09:44 +08:00 committed by GitHub
parent a4ef02a47b
commit 6744cd47ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -167,7 +167,6 @@ export default {
nextLink: "", nextLink: "",
listing: null, listing: null,
name: "", name: "",
subtitles: [],
fullSize: false, fullSize: false,
showNav: true, showNav: true,
navTimeout: null, navTimeout: null,
@ -201,6 +200,12 @@ export default {
isResizeEnabled() { isResizeEnabled() {
return resizePreview; return resizePreview;
}, },
subtitles() {
if (this.req.subtitles) {
return api.getSubtitlesURL(this.req);
}
return [];
},
}, },
watch: { watch: {
$route: function () { $route: function () {
@ -266,10 +271,6 @@ export default {
this.autoPlay = false; this.autoPlay = false;
} }
if (this.req.subtitles) {
this.subtitles = api.getSubtitlesURL(this.req);
}
let dirs = this.$route.fullPath.split("/"); let dirs = this.$route.fullPath.split("/");
this.name = decodeURIComponent(dirs[dirs.length - 1]); this.name = decodeURIComponent(dirs[dirs.length - 1]);