Conversation
uploadAsset adds the command-line tags to the asset before uploading; replaceAsset (a bigger version of a server asset, or --overwrite) called AssetUpload directly, so the replacement asset never got them. Factor the tagging into addCommandLineTags and call it from both.
Test_Replace runs the second upload with --tag and expects the five upgraded assets to be tagged; without the addCommandLineTags call in replaceAsset it reports 0.
--session-tag is a boolean flag; the tag added is the session name. Also note that the tags are applied on the server by processUploadedAsset, not by the upload itself.
Instead of each upload path (uploadAsset, replaceAsset) adding the command-line tags to the asset before uploading, add them once in processUploadedAsset, immediately before manageAssetTags — the single place where an asset's tags are applied on the server. This removes the duty of every upload path to remember the command-line tags, so a future upload path cannot forget them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix
--tagand--session-tagnot being applied to replacement uploads (a bigger copy replacing a smaller server copy, reported as "server asset upgraded", or an--overwritereplacement); only assets uploaded as new got those tags.Cause
uploadAssetadds the command-line tags to the asset before uploading; the upload itself does not send tags,processUploadedAssetapplies them afterwards.replaceAssetuploads without adding them, soprocessUploadedAssethas nothing to apply.Fix
Add the command-line tags in
processUploadedAsset(the one place tags are applied) instead of in each upload path, so no upload path can forget them.Test_Replacenow passes--tag=replacedfor the replacement run and expects the upgraded assets to be tagged; it fails without the fix.Notes
Based on
mainrather thandevelop, because it was tested against Immich v3, whose support is onmainonly.