Request based on filename

This commit is contained in:
2021-12-30 19:57:06 +03:00
parent 52d8664134
commit 307f92e4f7
2 changed files with 4 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ export interface Room {
magnet: string;
createdAt: Date;
movie?: string;
filename?: string;
downloaded?: boolean;
downloadedAt?: Date;
position: number;

View File

@@ -12,12 +12,12 @@
<video
v-if="room.downloaded"
controls
:src="movieUrl"
ref="video"
@seeked="seeked"
@play="playing = true"
@pause="playing = false"
>
<source :src="movieUrl" type="video/mp4">
</video>
</div>
</template>
@@ -55,7 +55,7 @@ export default defineComponent({
},
computed: {
movieUrl() {
return `${process.env.VUE_APP_MOVIES}?id=${this.room.id}`;
return `${process.env.VUE_APP_MOVIES}?filename=${this.room.filename}`;
},
progressPerc() {
return Math.floor(this.progress * 100);
@@ -68,7 +68,7 @@ export default defineComponent({
this.progressInterval = setInterval(async () => {
const result = await getStatus(this.id);
this.progress = result.progress;
if (result.downloaded) {
if (result.downloaded || this.progress === 1) {
this.room.downloaded = true;
clearInterval(this.progressInterval);
}