Salvoxia / immich-folder-album-creator

Automatically create and populate albums in Immich from a folder structure in external libraries
https://hub.docker.com/r/salvoxia/immich-folder-album-creator
222 stars 13 forks source link

Not finding albums? #20

Closed luis15pt closed 4 months ago

luis15pt commented 4 months ago

Hey, @Salvoxia thanks for your time to put together this tool!

i have abou 20,000 pictures in which i have put them into various folders:

root@Docker:/share/Fotos/Imagens# ls -l

total 151148
drwxrwxrwx  3 ubuntu users    69632 Jan  4  2023  100CASIO
drwxrwxrwx  3 ubuntu users     4096 Oct  3  2022  2003-07-Example1
drwxrwxrwx  3 ubuntu users     4096 Oct  3  2022  2003-08-Example2
drwxrwxrwx  3 ubuntu users     4096 Oct  3  2022  2003-08-Example4
drwxrwxrwx  3 ubuntu users     4096 Oct  3  2022 '2003-08-Example5'

root@Docker:/share/Container/immich# python3 ./immich_auto_album.py /share/Fotos/Imagens https://pics.example1.com/api my_key_here Output:

time=2024-06-30T23:14:25.813+00:00 level=INFO msg=Detected Immich server version 1.106.4
time=2024-06-30T23:14:25.813+00:00 level=INFO msg=Requesting all assets
time=2024-06-30T23:14:35.942+00:00 level=INFO msg=21135 photos found
time=2024-06-30T23:14:35.943+00:00 level=INFO msg=Sorting assets to corresponding albums using folder name
time=2024-06-30T23:14:35.949+00:00 level=INFO msg=0 albums identified
time=2024-06-30T23:14:35.949+00:00 level=INFO msg=Album list: []
Press Enter to continue, Ctrl+C to abort

What am i missing ?

Salvoxia commented 4 months ago

So you have a host called Docker which has a folder /share/Fotos/Imagens. Am I right to assume that this is not inside your Immich docker container but your Docker host that runs the Immich containers? If so, what path have you mounted /share/Fotos/Imagens to in the Immich containers? That's what root_path is supposed to be set to.

luis15pt commented 4 months ago

So my Docker compose has the following:


    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - ${EXTERNAL_PATH}:/usr/src/app/external

and my .env has: EXTERNAL_PATH=/share/Fotos/Imagens

What should i be using ?

Salvoxia commented 4 months ago

The correct call is python3 ./immich_auto_album.py /usr/src/app/external https://pics.example1.com/api my_key_here, since Immich will only see your pictures under the folder /user/src/app/external/...

luis15pt commented 4 months ago

Amazing that solved the issue, maybe your documentation could be improved as it was not obvious to me this would be an issue.

Imported 229 Albums from over the 20,000 pictures!

This should really be built into the official Immich as a tool.

luis15pt commented 4 months ago

@Salvoxia i´ve put a suggestion to implement your script into Immich, https://github.com/immich-app/immich/discussions/10769

Salvoxia commented 4 months ago

Amazing that solved the issue, maybe your documentation could be improved as it was not obvious to me this would be an issue.

Thanks for the suggestion, I added a section explaining what the root_path is supposed to be. Please let me know if you have suggestions to further clarify.

@Salvoxia i´ve put a suggestion to implement your script into Immich, https://github.com/immich-app/immich/ discussions/10769

Thanks! Let's see what's coming from that, but I imagine such a feature would be compounded into something like Nested Albums, which has been discussed for a long time now.