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
159 stars 9 forks source link

Share created albums with partner #34

Closed janwdev closed 4 weeks ago

janwdev commented 1 month ago

Hey, thanks for the great script, it really helped me migrate to immich! I have a little feature request: I have partner sharing turned on for the immich family account so all the family members can see all of the family images. Would it be possible to implement a solution, that allows to share all through this script newly created albums with the partner accounts, so they show up in the shared section of their accounts?

The great amount of all family albums would make this feature very handy! Thanks in advance already for your answer!

Salvoxia commented 1 month ago

Hi,

that's certainly possible. You would have to pass the list of users to share the created albums with as an argument / environment variable --share-with User1:User2:User3 / -e SHARE_WITH="User1:User2:User3". Sharing would only happen when an album is initially created, not when new assets are added to an existing album.

Would that work for you?

Best Regards, Salvoxia

janwdev commented 1 month ago

This would work wonderful, however im not able to make it work yet, is this already implemented? I use the script with docker compose and this is my compose file, maybe there is an error with it?

name: immich-albums
services:
  immich_albums-fam_create:
    container_name: immich_albums-fam_create
    image: salvoxia/immich-folder-album-creator:latest
    restart: unless-stopped
    environment:
      API_URL: http://ip:port/api/
      API_KEY: myAPIKey
      ROOT_PATH: /mnt/media/family
      ALBUM_LEVELS: 2
      ALBUM_SEPARATOR: " - "
      SHARE_WITH: "user1@example.com:user2@example.com"
      CRON_EXPRESSION: "0 * * * *"
      TZ: Europe/Berlin
Salvoxia commented 1 month ago

Haha, sorry for the confusion, this is not implemented yet. I was just describing how I imagine it to look like when it's done.

janwdev commented 1 month ago

Oh that explains it :D Yes, that would work perfectly, thanks so much for this cool tool again!

Salvoxia commented 1 month ago

Hi,

this is now implemented on the dev branch. Could you please test if it works correctly for you using the edge Docker image tag? In addition to the SHARE_WITH environment variable, SHARE_ROLE is also available with allowed values of viewer (default) or editor.

Looking forward to your feedback!

Best Regards, Salvoxia

janwdev commented 1 month ago

This works perfectly for my needs, thank you! The only thing that came to my mind is, that it might be helpful to define the role per user. Could be archived through a list of roles, which would correspond through their index with the user list. If there is only one role, that one would then apply for all defined users.

I am so happy about this feature and thanks so much for the quick help!

Salvoxia commented 1 month ago

Hm, the bare python script does not accept a list but you specify --share-with multiple times, so I'll try to think of a way to pass individual roles per user.

Salvoxia commented 1 month ago

ok, user-fine share roles are now implemented in the edge image as well. You would specify it like this:

SHARE_WITH: "user1@example.com=editor:user2@example.com=viewer"

Remember to force pull the edge tag when testing :)

Salvoxia commented 4 weeks ago

Released in 0.9.0.