Skip to content

Commit

Permalink
show descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
chregu committed Mar 15, 2024
1 parent 35d84cc commit f1c9f9c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dayjs": "1.11.5",
"lodash-es": "4.17.21",
"paths-to-tree-structure": "1.0.7",
"rokka": "^3.14.0",
"rokka": "^3.15.0",
"vue": "2.7.10",
"vue-clipboard2": "0.3.3",
"vue-gallery": "2.0.1",
Expand Down
37 changes: 34 additions & 3 deletions src/components/ImageModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@
@image-do-reload="loadImageDataFromRokka"
/>
</CollapsibleSection>

<CollapsibleSection
title="Auto Descriptions"
key-name="autodescriptions"
:data="autoDescriptions"
/>
<CollapsibleSection
title="Location"
key-name="location"
Expand All @@ -98,6 +102,7 @@
key-name="other"
:data="otherMetadata"
/>

<CollapsibleSection
title="Video"
key-name="video"
Expand All @@ -110,7 +115,7 @@
:data="dynamicMetadata"
/>
<CollapsibleSection
title="Autolabels"
title="Auto Labels"
key-name="autolables"
:data="autolabels.length > 0"
>
Expand All @@ -126,6 +131,7 @@
key-name="otherstatic"
:data="otherStatic"
/>

<CollapsibleSection
v-if="globalOptions.deleteEnabled && globalOptions.canWrite"
title="Delete image"
Expand Down Expand Up @@ -294,7 +300,8 @@ export default {
b !== 'exif' &&
b !== 'location' &&
b !== 'video' &&
b !== 'autolabels'
b !== 'autolabels' &&
b !== 'auto_description'
) {
metadata.push({ key: b, value: a });
}
Expand All @@ -308,6 +315,30 @@ export default {
}
return metadata;
},
autoDescriptions() {
const metadata = [];
if (
this.localImage.static_metadata &&
this.localImage.static_metadata.auto_description &&
this.localImage.static_metadata.auto_description.descriptions
) {
forEach(
this.localImage.static_metadata.auto_description.descriptions,
(a, b) => {
metadata.push({ key: b, value: a });
}
);
metadata.sort((a, b) => {
if (a.key > b.key) {
return 1;
}
return -1;
});
}
return metadata;
},
dynamicMetadata() {
const metadata = [];
Expand Down
2 changes: 2 additions & 0 deletions src/views/ImagesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export default {
'user:text:title',
'static:text:exif:description',
'static:text:exif:title',
'static:array_text:auto_description:descriptions',
];
const searchFieldsLowerCased = [
'user:array:labels',
Expand All @@ -116,6 +117,7 @@ export default {
'static:str:location:state',
'static:str:location:city',
'static:array:autolabels:labels',
'static:array_text:auto_description:descriptions',
];
if (this.query.length > 0) {
if (this.query.includes('=')) {
Expand Down

0 comments on commit f1c9f9c

Please sign in to comment.