aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/services
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src/services')
-rw-r--r--viewer/src/services/navigation.ts14
-rw-r--r--viewer/src/services/ui/ldItemResourceUrl.ts8
2 files changed, 17 insertions, 5 deletions
diff --git a/viewer/src/services/navigation.ts b/viewer/src/services/navigation.ts
index b2e807b..fb01169 100644
--- a/viewer/src/services/navigation.ts
+++ b/viewer/src/services/navigation.ts
@@ -19,7 +19,18 @@
19 19
20import { DirectoryItem, DownloadableItem, Item } from '@/@types/gallery'; 20import { DirectoryItem, DownloadableItem, Item } from '@/@types/gallery';
21import { ItemType } from '@/@types/itemType'; 21import { ItemType } from '@/@types/itemType';
22import { faFile, faFileAlt, faFileAudio, faFilePdf, faFileVideo, faFolder, faHome, faImage, IconDefinition } from '@fortawesome/free-solid-svg-icons'; 22import {
23 faFile,
24 faFileAlt,
25 faFileAudio,
26 faFilePdf,
27 faBook,
28 faFileVideo,
29 faFolder,
30 faHome,
31 faImage,
32 IconDefinition,
33} from '@fortawesome/free-solid-svg-icons';
23import { isDirectory } from './itemGuards'; 34import { isDirectory } from './itemGuards';
24 35
25const ICON_BY_TYPE: Record<ItemType, IconDefinition> = { 36const ICON_BY_TYPE: Record<ItemType, IconDefinition> = {
@@ -28,6 +39,7 @@ const ICON_BY_TYPE: Record<ItemType, IconDefinition> = {
28 plaintext: faFileAlt, 39 plaintext: faFileAlt,
29 markdown: faFileAlt, 40 markdown: faFileAlt,
30 pdf: faFilePdf, 41 pdf: faFilePdf,
42 epub: faBook,
31 video: faFileVideo, 43 video: faFileVideo,
32 audio: faFileAudio, 44 audio: faFileAudio,
33 other: faFile, 45 other: faFile,
diff --git a/viewer/src/services/ui/ldItemResourceUrl.ts b/viewer/src/services/ui/ldItemResourceUrl.ts
index 7db7ab9..d6734b3 100644
--- a/viewer/src/services/ui/ldItemResourceUrl.ts
+++ b/viewer/src/services/ui/ldItemResourceUrl.ts
@@ -1,12 +1,12 @@
1import { Item } from '@/@types/gallery'; 1import { Item } from '@/@types/gallery';
2import { useGalleryStore } from '@/store/galleryStore'; 2import { useGalleryStore } from '@/store/galleryStore';
3import { computed } from 'vue'; 3import { computed, ToRef } from 'vue';
4import { isDownloadableItem } from '../itemGuards'; 4import { isDownloadableItem } from '../itemGuards';
5 5
6export const useItemResource = (item: Item) => { 6export const useItemResource = (item: ToRef<Item>) => {
7 const galleryStore = useGalleryStore(); 7 const galleryStore = useGalleryStore();
8 const itemResourceUrl = computed(() => isDownloadableItem(item) ? galleryStore.resourceRoot + item.properties.resource : ''); 8 const itemResourceUrl = computed(() => isDownloadableItem(item.value) ? galleryStore.resourceRoot + item.value.properties.resource : '');
9 const thumbnailResourceUrl = computed(() => item.thumbnail ? galleryStore.resourceRoot + item.thumbnail.resource : ''); 9 const thumbnailResourceUrl = computed(() => item.value.thumbnail ? galleryStore.resourceRoot + item.value.thumbnail.resource : '');
10 10
11 return { 11 return {
12 itemResourceUrl, 12 itemResourceUrl,