immich icon indicating copy to clipboard operation
immich copied to clipboard

fix(cli): `--ignore` getting ignored

Open mertalev opened this issue 10 months ago • 2 comments

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.

mertalev avatar Apr 25 '24 01:04 mertalev

Deploying immich with  Cloudflare Pages  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

View logs

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 on fast-glob anyway so replacing glob with it shrunk the build by about 65kb.

mertalev avatar Apr 25 '24 04:04 mertalev

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

TransRapid avatar Apr 30 '24 12:04 TransRapid

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

danieldietzler avatar Apr 30 '24 12:04 danieldietzler

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.

TransRapid avatar Apr 30 '24 15:04 TransRapid

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.

mertalev avatar Apr 30 '24 15:04 mertalev

Do we know when the fix will be released?

For me I did a script with a "find" workaround to avoid the unwanted directory.

macross5 avatar May 24 '24 20:05 macross5