CLI
CLI copied to clipboard
Changed mime library to mime ^3.0.0 and add custom mimes for raw images
Given https://github.com/immich-app/CLI/issues/47, the problem relied on in the fact that mime-types does not recognize raw photo formats (.nef for Nikon, probably more of them for other brands) and so those won't be uploaded.
My solution is to migrate from mime-types to mime to be able to use the ability to define custom mime types.
Because of that, all the non-default types are placed in an object associating their file extensions.
Thanks for the PR! A few thoughts:
- We're looking to move all the mimetype checks and such to the server (#27), so I'm not too keen to add more edge cases here.
- I think we should be careful about using a different mimetype lib in the CLI vs in the server
- That
--regexflag should at least be a separate PR - I think instead of filtering like
--regexbuilt in to the CLI, a better option would be something like--files-from-stdin, so the CLI can be used with standard linux utilities:find . -name "FOO_*" | immich --files-from-stdin
@alextran1502 want to make sure you see this, I think you don't get pings for new CLI PRs.
Just gonna note here and say that this PR successfully uploaded all my NEF photos but it seems that they aren't being properly rendered by immich (very low res jpg is shown) even on the latest immich update, so it seems there has to be more done on immich's side.