diff options
author | pacien | 2020-05-19 21:05:28 +0200 |
---|---|---|
committer | Notkea | 2020-05-22 01:02:18 +0200 |
commit | a2e06f0a217b12d92cecdad77c20de88037f9912 (patch) | |
tree | 1c74a7e0532f4169be60556c5b6f16b74c620d5a /viewer/src/components/LdDownload.vue | |
parent | 037db071d42d4a7fdb8ed5cf88bc2c37fba4ae93 (diff) | |
download | ldgallery-a2e06f0a217b12d92cecdad77c20de88037f9912.tar.gz |
viewer/navigation: factorise item file name extraction
Diffstat (limited to 'viewer/src/components/LdDownload.vue')
-rw-r--r-- | viewer/src/components/LdDownload.vue | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/viewer/src/components/LdDownload.vue b/viewer/src/components/LdDownload.vue index aea4123..d7dfb7d 100644 --- a/viewer/src/components/LdDownload.vue +++ b/viewer/src/components/LdDownload.vue | |||
@@ -30,21 +30,17 @@ | |||
30 | 30 | ||
31 | <script lang="ts"> | 31 | <script lang="ts"> |
32 | import { Component, Prop, Vue } from "vue-property-decorator"; | 32 | import { Component, Prop, Vue } from "vue-property-decorator"; |
33 | import Navigation from "@/services/navigation"; | ||
33 | 34 | ||
34 | @Component export default class LdDownload extends Vue { | 35 | @Component export default class LdDownload extends Vue { |
35 | @Prop({ required: true }) readonly item!: Gallery.Other; | 36 | @Prop({ required: true }) readonly item!: Gallery.Other; |
36 | 37 | ||
37 | itemResource(): string { | ||
38 | return this.item.properties.resource; | ||
39 | } | ||
40 | |||
41 | itemFileName(): string { | 38 | itemFileName(): string { |
42 | const timeStamped = this.itemResource().split("/").pop() ?? ""; | 39 | return Navigation.getFileName(this.item); |
43 | return timeStamped.split("?")[0]; | ||
44 | } | 40 | } |
45 | 41 | ||
46 | itemDownloadUrl(): string { | 42 | itemDownloadUrl(): string { |
47 | return this.$galleryStore.resourceRoot + this.itemResource(); | 43 | return this.$galleryStore.resourceRoot + this.item.properties.resource; |
48 | } | 44 | } |
49 | } | 45 | } |
50 | </script> | 46 | </script> |