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

add IMAGE.ID.NEXT for the next image id to be assigned on import #17679

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

ralfbrown
Copy link
Collaborator

$(ID) / $(IMAGE.ID) are not available for renaming in a copy&import session, but we can easily get the maximum image id currently in the database and add one to get the next image id to be assigned[*]. This PR adds a new variable $(IMAGE.ID.NEXT) which substitutes in exactly that value. It takes an optional parameter specifying how many zero-padded digits to use, e.g. $(IMAGE.ID.NEXT[5]) would return 00001 for an empty library. Also added the same optional parameter to $(ID) and $(IMAGE.ID) to permit a fixed field size when substituting.

[*] There is one corner case which is not handled - if one imports some images, removes the one(s) with highest id(s) and then imports again, the first image in the new session gets a value other than its ultimate image id substituted in.

Resolves #17676.

@ralfbrown ralfbrown added feature: enhancement current features to improve scope: DAM managing files, collections, archiving, metadata, etc. labels Oct 16, 2024
@TurboGit TurboGit added this to the 5.0 milestone Oct 17, 2024
Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit TurboGit merged commit 316e375 into darktable-org:master Oct 18, 2024
6 checks passed
@TurboGit TurboGit added priority: low core features work as expected, only secondary/optional features don't documentation-pending a documentation work is required release notes: pending labels Oct 18, 2024
@ralfbrown ralfbrown deleted the import_imgid branch October 18, 2024 21:01
@TurboGit
Copy link
Member

@ralfbrown : Can you draft a release note entry please? TIA.

@ralfbrown
Copy link
Collaborator Author

Already in the release notes. Documentation PR darktable-org/dtdocs#683 is pending.

@ralfbrown ralfbrown removed the documentation-pending a documentation work is required label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: enhancement current features to improve priority: low core features work as expected, only secondary/optional features don't scope: DAM managing files, collections, archiving, metadata, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make $(ID) work on import
2 participants