aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/views/GallerySearch.vue
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src/views/GallerySearch.vue')
-rw-r--r--viewer/src/views/GallerySearch.vue15
1 files changed, 6 insertions, 9 deletions
diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index e75a37e..fec7216 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -18,7 +18,7 @@
18--> 18-->
19 19
20<template> 20<template>
21 <ld-gallery :items="items()" :noresult="noResult()" /> 21 <ld-gallery :items="items" :noresult="noResult" />
22</template> 22</template>
23 23
24<script lang="ts"> 24<script lang="ts">
@@ -29,8 +29,7 @@ import IndexSearch from "@/services/indexsearch";
29@Component 29@Component
30export default class GalleryPicture extends Vue { 30export default class GalleryPicture extends Vue {
31 @Prop(String) readonly path!: string; 31 @Prop(String) readonly path!: string;
32 32 otherCount: number = 0;
33 otherCount: Number = 0;
34 33
35 mounted() { 34 mounted() {
36 this.$uiStore.toggleFullscreen(false); 35 this.$uiStore.toggleFullscreen(false);
@@ -42,19 +41,17 @@ export default class GalleryPicture extends Vue {
42 this.$galleryStore.setCurrentSearch([]); 41 this.$galleryStore.setCurrentSearch([]);
43 } 42 }
44 43
45 items() { 44 get items() {
46 const searchResult = IndexSearch.search(this.$galleryStore.currentSearch); 45 const searchResult = IndexSearch.search(this.$galleryStore.currentSearch);
47 const filteredByPath = searchResult.filter(item => item.path.startsWith(this.path)); 46 const filteredByPath = searchResult.filter(item => item.path.startsWith(this.path));
48 this.otherCount = searchResult.length - filteredByPath.length; 47 this.otherCount = searchResult.length - filteredByPath.length;
49 return filteredByPath; 48 return filteredByPath;
50 } 49 }
51 50
52 noResult() { 51 get noResult() {
53 const params = [this.otherCount, this.otherCount > 1 ? "s" : ""]; 52 return this.$tc("search.no-result-fmt", this.otherCount, [this.otherCount]);
54 return this.$t("search.no-results.otherfolders", params);
55 } 53 }
56} 54}
57</script> 55</script>
58 56
59<style lang="scss"> 57<style lang="scss"></style>
60</style>