Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Add option to append tags #339

Merged
merged 6 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/main/lychee_locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ lychee.locale = {
PHOTOS_NEW_TAGS:
"Enter your tags for all %d selected photos. Existing tags will be overwritten. You can add multiple tags by separating them with a comma:",
PHOTO_SET_TAGS: "Set Tags",
TAGS_OVERRIDE_INFO: "If this is unchecked, the tags will be added to the existing tags of the photo.",
PHOTO_CAMERA: "Camera",
PHOTO_CAPTURED: "Captured",
PHOTO_MAKE: "Make",
Expand Down
9 changes: 5 additions & 4 deletions scripts/main/photo.js
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,8 @@ photo.editTags = function (photoIDs) {
<div class="input-group stacked"><input class='text' name='tags' type='text' minlength='1'></div>
<div class='input-group compact-inverse'>
<label for="override">${lychee.locale["OVERRIDE"]}</label>
<input type='checkbox' id='override' name='override' />
<input type='checkbox' id='tag_dialog_override_input' name='override' />
<p>${lychee.locale["TAGS_OVERRIDE_INFO"]}</p>
qwerty287 marked this conversation as resolved.
Show resolved Hide resolved
</div>
</form>`;

Expand Down Expand Up @@ -848,10 +849,10 @@ photo.editTags = function (photoIDs) {
/**
* @param {string[]} photoIDs
* @param {string[]} tags
* @param {boolean} override
* @param {boolean} shall_override
* @returns {void}
*/
photo.setTags = function (photoIDs, tags, override) {
photo.setTags = function (photoIDs, tags, shall_override) {
if (visible.photo()) {
photo.json.tags = override ? tags : photo.json.tags.concat(tags.filter((t) => !photo.json.tags.includes(t)));
qwerty287 marked this conversation as resolved.
Show resolved Hide resolved
view.photo.tags();
Expand All @@ -866,7 +867,7 @@ photo.setTags = function (photoIDs, tags, override) {
{
photoIDs: photoIDs,
tags: tags,
override: override,
shall_override: shall_override,
},
function () {
// If we have any tag albums, force a refresh.
Expand Down