Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

batch-edit: adding new keywords causes deletion of existing keywords #1018

Closed
pekingduck opened this issue Mar 14, 2023 · 4 comments
Closed
Labels
feature request New feature or request

Comments

@pekingduck
Copy link

osxphotos: 0.58.1, installed using pipx
OS: Ventura 13.2.1 (M1 Mac)

If I add some new keyword(s) to an image using osxphotos batch-edit --keyword xxx, all original/existing keywords (say "yyy" and "zzz") are deleted. Is this the intended behaviour?

Thanks

@RhetTbull RhetTbull added the feature request New feature or request label Mar 14, 2023
@RhetTbull
Copy link
Owner

This is by design but it may not be the best design. The --keyword option means "set keywords to this value" which as you noted overwrites existing keywords. I did this because the --title and --description options overwrite the existing values and felt it was more consistent for keywords to do the same. I'm open to changing this behavior if it's not obvious. Maybe add a --overwrite-keywords flag that, if not present, causes keywords to be appended.

In the meantime, you can add --keyword "{keyword}" (which is shown in the help text for batch-edit) which means "also add any existing keywords"

@RhetTbull
Copy link
Owner

@all-contributors please add @pekingduck for ideas

@allcontributors
Copy link
Contributor

@RhetTbull

I've put up a pull request to add @pekingduck! 🎉

@RhetTbull
Copy link
Owner

@pekingduck I changed the batch-edit behavior in v0.58.2 so that it no longer overwrites the existing keywords and instead merges new keywords with the existing keywords. I also added a --replace-keywords option that causes existing keywords to be overwritten if specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants