-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(cli): watch paths for auto uploading daemon #14923
base: main
Are you sure you want to change the base?
Conversation
78824da
to
32ba427
Compare
options: UploadOptionsDto, | ||
{ | ||
batchSize = UPLOAD_WATCH_BATCH_SIZE, | ||
debounceTimeMs = UPLOAD_WATCH_DEBOUNCE_TIME_MS, | ||
}: { batchSize?: number; debounceTimeMs?: number } = {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should only pass a single options object here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered doing this, but it would be error prone to mix/unmix watch-specific params with the UploadOptionsDto
which would be later passed into uploadBatch()
const extensions = new Set([...image, ...video]); | ||
|
||
if (options.ignore) { | ||
watcherIgnored.push((path) => micromatch.contains(path, `**/${options.ignore}`)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the ignored path contains special characters?, like curly brace, comma, $, etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will be handled in the same way as crawl()
, which internally calls fast-glob
and then also micromatch
:
https://github.com/eligao/immich/blob/fe71f7303ddc0950f7f8464853dac27fdf99fe38/cli/src/utils.ts#L160
c267202
to
3e74c98
Compare
Adds a
--watch
flag to continue watching for changes after initial upload.immich upload ./assets/ --watch
--watch
, as it batch uploads all current items in one go.--no-progress
flag to hide progress bars to make logs cleaner when running as a daemon--watch
flag