diff options
author | pacien | 2020-02-27 21:05:51 +0100 |
---|---|---|
committer | Notkea | 2020-02-27 21:36:39 +0100 |
commit | c7fa5bd40d0e5c9ea50190a90a0ccfee8ad96c25 (patch) | |
tree | 6c524899070301a13c7ce03bc6640d9c266bed71 /viewer/src | |
parent | 8f041b9f13b4c043acc7720aa4c082583b52ffe1 (diff) | |
download | ldgallery-c7fa5bd40d0e5c9ea50190a90a0ccfee8ad96c25.tar.gz |
viewer: use colon as tag separator instead of dot
For consistency with the query language
and allowing the use of the very common dot in tags.
This also introduces a migration script.
GitHub: closes #164
Diffstat (limited to 'viewer/src')
-rw-r--r-- | viewer/src/components/LdProposition.vue | 4 | ||||
-rw-r--r-- | viewer/src/services/indexfactory.ts | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/viewer/src/components/LdProposition.vue b/viewer/src/components/LdProposition.vue index 375c482..3357777 100644 --- a/viewer/src/components/LdProposition.vue +++ b/viewer/src/components/LdProposition.vue | |||
@@ -74,7 +74,7 @@ export default class LdProposition extends Vue { | |||
74 | } else { | 74 | } else { |
75 | // Tags count from the current directory | 75 | // Tags count from the current directory |
76 | this.currentTags | 76 | this.currentTags |
77 | .flatMap(tag => tag.split(".")) | 77 | .flatMap(tag => tag.split(":")) |
78 | .map(tag => this.tagsIndex[tag]) | 78 | .map(tag => this.tagsIndex[tag]) |
79 | .forEach(tagindex => (propositions[tagindex.tag] = tagindex.items.length)); | 79 | .forEach(tagindex => (propositions[tagindex.tag] = tagindex.items.length)); |
80 | } | 80 | } |
@@ -89,7 +89,7 @@ export default class LdProposition extends Vue { | |||
89 | } | 89 | } |
90 | 90 | ||
91 | rightmost(tag: Gallery.RawTag): Gallery.RawTag { | 91 | rightmost(tag: Gallery.RawTag): Gallery.RawTag { |
92 | const dot = tag.lastIndexOf("."); | 92 | const dot = tag.lastIndexOf(":"); |
93 | return dot <= 0 ? tag : tag.substr(dot + 1); | 93 | return dot <= 0 ? tag : tag.substr(dot + 1); |
94 | } | 94 | } |
95 | 95 | ||
diff --git a/viewer/src/services/indexfactory.ts b/viewer/src/services/indexfactory.ts index a6bc865..6fed6cc 100644 --- a/viewer/src/services/indexfactory.ts +++ b/viewer/src/services/indexfactory.ts | |||
@@ -36,7 +36,7 @@ export default class IndexFactory { | |||
36 | return; // Directories are not indexed | 36 | return; // Directories are not indexed |
37 | } | 37 | } |
38 | for (const tag of item.tags) { | 38 | for (const tag of item.tags) { |
39 | const parts = tag.split('.'); | 39 | const parts = tag.split(':'); |
40 | let lastPart: string | null = null; | 40 | let lastPart: string | null = null; |
41 | for (const part of parts) { | 41 | for (const part of parts) { |
42 | if (!tagsIndex[part]) tagsIndex[part] = { tag: part, tagfiltered: Navigation.normalize(part), items: [], children: {} }; | 42 | if (!tagsIndex[part]) tagsIndex[part] = { tag: part, tagfiltered: Navigation.normalize(part), items: [], children: {} }; |