From a681accaa7617892bb7c53248aa9030a4eb47f50 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 28 Dec 2019 04:52:30 +0100 Subject: viewer: Tag propositions. Disabled directory indexation. Note: The propositions are not based on the current search results, but on the searched tags, which doesn't seem to be the correct way. We'll probably have to move the search results to a store for global visibility. --- viewer/src/store/galleryStore.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'viewer/src/store') diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts index 8a611ea..179fbe2 100644 --- a/viewer/src/store/galleryStore.ts +++ b/viewer/src/store/galleryStore.ts @@ -44,6 +44,10 @@ export default class GalleryStore extends VuexModule { // Pushes all tags for a root item (and its children) to the index private static pushTagsForItem(index: Tag.Index, item: Gallery.Item) { console.log("IndexingTagsFor: ", item.path); + if (item.properties.type === "directory") { + item.properties.items.forEach(item => this.pushTagsForItem(index, item)); + return; // Directories are not indexed + } for (const tag of item.tags) { const parts = tag.split('.'); let lastPart: string | null = null; @@ -54,8 +58,6 @@ export default class GalleryStore extends VuexModule { lastPart = part; } } - if (item.properties.type === "directory") - item.properties.items.forEach(item => this.pushTagsForItem(index, item)); } // Searches for an item by path from a root item (navigation) -- cgit v1.2.3