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

Adds a new flag to allow deleting duplicates such as those that have already been uploaded. #13131

Closed
wants to merge 3 commits into from

Conversation

rayzorben
Copy link

Currently once you have uploaded files to Immich, if you want to delete those after verifying them within Immich, you are unable to as they are marked as duplicates, and immich-cli only deletes new files.

This adds a new flag to allow deleting duplicates along with the new files, so that if you have already uploaded them to Immich you can now delete them locally.

Here is example usage showing a dry run of what this would do:

oot@5a237b7d69b0:/dropbox/Camera Uploads/2018-07# immich upload . -a -n --delete
Crawling for assets...
Checking files | ████████████████████████████████████████ | 100% | ETA: 0s | 172/172 assets
Found 172 new files and 0 duplicates
Would have uploaded 172 assets (1.1 GB)
Would have created 1 new album
Would have updated albums of 172 assets
Would have deleted 172 local assets
root@5a237b7d69b0:/dropbox/Camera Uploads/2018-07# cd /dropbox/Photos/2004\ Engagement\:Wedding\ Photos/
root@5a237b7d69b0:/dropbox/Photos/2004 Engagement:Wedding Photos# immich upload . -a -n --delete
Crawling for assets...
Checking files | ████████████████████████████████████████ | 100% | ETA: 0s | 42/42 assets
Found 0 new files and 42 duplicates
All assets were already uploaded, nothing to do.
Would have created 0 new albums
Would have updated albums of 42 assets
Would have deleted 0 local assets
root@5a237b7d69b0:/dropbox/Photos/2004 Engagement:Wedding Photos# immich upload . -a -n --delete --delete-duplicates
Crawling for assets...
Checking files | ████████████████████████████████████████ | 100% | ETA: 0s | 42/42 assets
Found 0 new files and 42 duplicates
All assets were already uploaded, nothing to do.
Would have created 0 new albums
Would have updated albums of 42 assets
Would have deleted 42 local assets

added deleteDuplicates support
added new flag to allow deleting duplicates
@github-actions github-actions bot added the cli Tasks related to the Immich CLI label Oct 2, 2024
@rayzorben
Copy link
Author

Please give guidance if this change is appreciated on how to pass PR Label Validation by adding a changelog label.

@bo0tzz
Copy link
Member

bo0tzz commented Oct 2, 2024

Does this need to be a separate flag?

@rayzorben
Copy link
Author

Does this need to be a separate flag?

I don't want to break existing functionality. If you would prefer just to always delete new files and duplicates, I can certainly do that.

@rayzorben rayzorben closed this Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:enhancement cli Tasks related to the Immich CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants