immich
immich copied to clipboard
fix(cli): `--ignore` getting ignored
Description
The internal typing for this flag expects exclusionPatterns
, so it will always consider it to be undefined
.
How Has This Been Tested?
Tested that it actually ignores the pattern specified in the command.
Deploying immich with
Cloudflare Pages
Latest commit: |
0ece226
|
Status: | ✅ Deploy successful! |
Preview URL: | https://2e9f870f.immich.pages.dev |
Branch Preview URL: | https://fix-cli-ignore.immich.pages.dev |
It turns out there was more than one issue here:
-
--ignore
has confusing behavior: it's sensitive to the order of the flags (particularly whether it comes before or after the upload path(s)) because it can take multiple arguments. The behavior is predictable if it can only accept one string. - The behavior is different when a search pattern has
..
: it ignores the--ignore
flag in this case. Resolving the path fixes this. - Lastly, the
glob
library still failed to ignore files even with the above changes.fast-glob
does behave as expected. As a nice bonus, it seems something else depends onfast-glob
anyway so replacingglob
with it shrunk the build by about 65kb.
immich upload -n -i /Recently/ -r /media/Vault/Apple\ iCloud\ Photos/7/iCloud\ Photos\ Part\ 68\ of\ 68/ Crawling for assets... Checking files | ████████████████████████████████████████ | 100% | ETA: 0s | 2/2 assets Found 2 new files and 0 duplicates Would have uploaded 2 assets (9.5 MB)
Expected behavior would be 0 assets as the only 2 things are in a folder titled. Recently Deleted
The CLI does not randomly ignore folders because of their name. And IMO that's a good thing, in case that's what you're referring to @TransRapid
No, the issue is the --ignore
just does not work as described . The ignore pattern does not ignore using the CLI, it does however work using the GUI, that is the more unusual part.
Can you confirm that you're actually using a CLI build that has the fixes in this PR? It isn't in the latest CLI release.
Do we know when the fix will be released?
For me I did a script with a "find" workaround to avoid the unwanted directory.