loeeeee / immich-in-lxc

Install Immich in LXC with optional CUDA support
30 stars 3 forks source link

Get customs locations for the thumbs directory #8

Closed firemess closed 2 weeks ago

firemess commented 1 month ago

First of all a great thanks for this version of immich, it totally solved my issues with nvidia gpu (that was not working on docker, I don't know why).

Is it possible to change the location of the thumbs directory ? I wanted to store them on a fast SSD (and upload remains on HDD). This is possible with the docker version, I tried to figured out how to do it here but I can't.

Thank you !

loeeeee commented 1 month ago

When I was writing the tutorial, I have the same problem of wanting to store them separately. While I was testing things out, I noticed a goofy design choice made by Immich -- the thumbnails are actually stored in upload folder.

In other words, by changing UPLOAD_DIR in .env during install, one could change where the thumbnails locates. However, this had the side effect of changing where the actual uploaded photos go.

If one would like to separately store the thumbnails in a different directory, without the aforementioned side effects, one may try to mount the source directory, i.e. the directories in that fast SSD, into the target, i.e. UPLOAD_DIR/thumbs, and optionally UPLOAD_DIR/encoded-video.

To achieve this, make sure that the thumbs/encoded-video folders do not exists inside the upload folder. If they do, it is safe to delete these two. (YOU WILL LOSE EXISTING THUMBNAILS AND TRANSCODED VIDEOS!)

ln -s /mnt/SSD/blahblahblah/thumbs /home/immich/upload/thumbs
ln -s /mnt/SSD/blahblahblah/whatevernameyoulike /home/immich/upload/encoded-video

Also, make sure the target directory is inside UPLOAD_DIR (defined in .env), and is not in INSTALL_DIR/app/upload, because the link to the latter one will be deleted during immich upgrade.

After all these, the immich will have its generated thumbnails on wherever one wants.

A side note, personally I do not recommend using the upload function in Immich, rather the external library is a personally preferred way of give immich the access to photos, because by default, immich will reorganize the uploaded photos into a tree-ish folder with all file names in hashed gibberish. This will be a pain to manage if one decided quit using immich. Only personally opinion though, one should always take this with a grain of salt.

firemess commented 1 month ago

Thanks for you quick answer. Agree for not using upload directoy, but unfortunately I need it as I want to import my Google Photos library from takeout archives with immich-go, and with this method it goes to upload. I tried to change directory thumbs with a symlink, but I get other issues in the apps (i'm reinstalling it but if I still got those issues I will post it here).

loeeeee commented 1 month ago

I tried to change directory thumbs with a symlink, but I get other issues in the apps (i'm reinstalling it but if I still got those issues I will post it here).

Don't forget to setup proper permission as well so that the user immich has access to those directory. 😃

loeeeee commented 2 weeks ago

Bro not responding, closing the issue. 😃