-
-
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
c267202
to
3e74c98
Compare
batchSize, | ||
debounceTimeMs, | ||
onBatch: async (paths: string[]) => { | ||
const uniquePaths = [...new Set(paths)]; |
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.
When would these ever not be unique?
return; | ||
} | ||
const ext = '.' + path.split('.').pop()?.toLowerCase(); | ||
if (!extensions.has(ext ?? '')) { |
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.
!ext || !extensions.has(ext)
if (!extensions.has(ext ?? '')) { | ||
return; | ||
} | ||
console.log(`Change detected: ${path}`); |
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.
How does this interact with the progress bar?
@@ -69,6 +69,13 @@ program | |||
.default(4), | |||
) | |||
.addOption(new Option('--delete', 'Delete local assets after upload').env('IMMICH_DELETE_ASSETS')) | |||
.addOption(new Option('--no-progress', 'Hide progress bars').env('IMMICH_PROGRESS_BAR').default(true)) |
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.
Why is this hiding progress by default? The option and the env name are confusing me.
this.onBatch([...this.items]); | ||
|
||
this.items.length = 0; |
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.
Pass this.items
without cloning and then set it to a new empty array.
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