From a4ef02a47b53742a0ac1f639563b0c67116619c8 Mon Sep 17 00:00:00 2001 From: Yeicor <4929005+Yeicor@users.noreply.github.com> Date: Mon, 1 May 2023 13:07:01 +0200 Subject: [PATCH 1/2] feat: add option to copy download links from shares (#2442) --- frontend/src/components/prompts/Share.vue | 20 +++++++++++++- frontend/src/i18n/en.json | 1 + frontend/src/views/Share.vue | 33 +++++++++++++++++++++-- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/prompts/Share.vue b/frontend/src/components/prompts/Share.vue index 210b2f93..c0c3c083 100644 --- a/frontend/src/components/prompts/Share.vue +++ b/frontend/src/components/prompts/Share.vue @@ -32,6 +32,16 @@ content_paste + + + { + this.$showSuccess(this.$t("success.linkCopied")); + }); }, beforeDestroy() { window.removeEventListener("keydown", this.keyEvent); + this.clip.destroy(); }, computed: { ...mapState(["req", "loading", "multiple", "selected"]), - ...mapGetters(["selectedCount", "selectedCount"]), + ...mapGetters(["selectedCount"]), icon: function () { if (this.req.isDir) return "folder"; if (this.req.type === "image") return "insert_photo"; @@ -300,8 +316,13 @@ export default { toggleMultipleSelection() { this.$store.commit("multiple", !this.multiple); }, + isSingleFile: function () { + return ( + this.selectedCount === 1 && !this.req.items[this.selected[0]].isDir + ); + }, download() { - if (this.selectedCount === 1 && !this.req.items[this.selected[0]].isDir) { + if (this.isSingleFile()) { api.download( null, this.hash, @@ -326,6 +347,14 @@ export default { }, }); }, + linkSelected: function () { + return this.isSingleFile() + ? api.getDownloadURL({ + hash: this.hash, + path: this.req.items[this.selected[0]].path, + }) + : ""; + }, }, }; From 6744cd47cef87e3a76a2190bdf123b6c2197fe6f Mon Sep 17 00:00:00 2001 From: ULiiAn Date: Mon, 1 May 2023 19:09:44 +0800 Subject: [PATCH 2/2] fix: video preview click next or prev button subtitles not update (#2423) --- frontend/src/views/files/Preview.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/files/Preview.vue b/frontend/src/views/files/Preview.vue index d08ac5aa..7a731458 100644 --- a/frontend/src/views/files/Preview.vue +++ b/frontend/src/views/files/Preview.vue @@ -167,7 +167,6 @@ export default { nextLink: "", listing: null, name: "", - subtitles: [], fullSize: false, showNav: true, navTimeout: null, @@ -201,6 +200,12 @@ export default { isResizeEnabled() { return resizePreview; }, + subtitles() { + if (this.req.subtitles) { + return api.getSubtitlesURL(this.req); + } + return []; + }, }, watch: { $route: function () { @@ -266,10 +271,6 @@ export default { this.autoPlay = false; } - if (this.req.subtitles) { - this.subtitles = api.getSubtitlesURL(this.req); - } - let dirs = this.$route.fullPath.split("/"); this.name = decodeURIComponent(dirs[dirs.length - 1]);