From b3d3bdf59c485bbb9dfeb93ce772935085e3042f Mon Sep 17 00:00:00 2001 From: Louis Eveillard Date: Wed, 13 Sep 2023 13:39:18 +0200 Subject: [PATCH] FIX / only update trim options when changed --- .../src/components/makes/TrimAudioVideo.vue | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/client/src/components/makes/TrimAudioVideo.vue b/client/src/components/makes/TrimAudioVideo.vue index b75eb59cd..73f90e392 100644 --- a/client/src/components/makes/TrimAudioVideo.vue +++ b/client/src/components/makes/TrimAudioVideo.vue @@ -235,12 +235,7 @@ export default { if (this.debounce_selection) clearTimeout(this.debounce_selection); this.debounce_selection = setTimeout(async () => { - await this.$api.updateMeta({ - path: this.make.$path, - new_meta: { - selection: this.selection, - }, - }); + await this.updateSelectionMeta(); }, 1000); }, setSelect() { @@ -248,6 +243,18 @@ export default { if (start !== this.selection.start || end !== this.selection.end) this.main_wfpl.getEventEmitter().emit("select", start, end); }, + async updateSelectionMeta() { + if ( + this.selection.start !== this.make.selection.start || + this.selection.end !== this.make.selection.end + ) + await this.$api.updateMeta({ + path: this.make.$path, + new_meta: { + selection: this.selection, + }, + }); + }, finished() { // this.pause(); },