immich-auto-stack icon indicating copy to clipboard operation
immich-auto-stack copied to clipboard

feat/v1.114.0 immich support

Open Majorfi opened this issue 1 year ago • 13 comments

As this is not being merged, I created my own version of immich-stack, which can be found here: https://github.com/Majorfi/immich-stack

While keeping the same general flow, this come with improvements and some changes, but should work just fine! Code available via executable, via go build or via docker package!

Enjoy!


Linked to https://github.com/tenekev/immich-auto-stack/issues/10 and https://github.com/tenekev/immich-auto-stack/issues/11

I ran into the same issue and gave it a shot. I am no python expert, so tried to make it work with the new stack endpoint as I could and tested it on my library (10k photos) with success.

Happy to answer any questions! Thank you Edit: You can run it with this for example: API_URL="YOUR_IMMICH_API_URL" API_KEY="YOUR_ACCOUNT_API_KEY" SKIP_PREVIOUS=True PARENT_PROMOTE="edit,crop,hdr" python immich_auto_stack.py

Majorfi avatar Sep 11 '24 10:09 Majorfi

Hey there and thanks for your input. Unfortunately it's very unlikely to merge all of this because I've already started work on an update. Recent discussions made me reconsider the scrip functionality as a whole and in order to implement them, I needed to rewrite and reorder most of it. It's not just a stacks update anymore. Hence the delay, among other reasons.

I looked through the changes and I'll take whatever I can.

tenekev avatar Sep 12 '24 08:09 tenekev

Just want to thank you, @Majorfi – I'm on holiday shooting and uploading daily and your commit worked a charm as a temporary fix to keep my timeline more organized while @tenekev works on their rewrite. Appreciate it and appreciate this script 🙌.

ste7enm avatar Sep 15 '24 18:09 ste7enm

@Majorfi I tested it as well, and its working well for me. Thanks!

kfoxton avatar Sep 23 '24 20:09 kfoxton

Thank you for your work @Majorfi! This is a great patch while @tenekev works on a re-write.

Here are the steps for folks who haven't built a docker image locally. If anyone has a different way let me know, but this worked for me.

How to:

I did this in a subfolder of my main immich directory (immich-app)

  1. clone the github repo
    1. cd immich-app (or whatever yours is called)
    2. git clone https://github.com/Majorfi/immich-auto-stack.git
    3. cd immich-auto-stack
    4. git checkout patch-1
  2. build it locally:
    1. docker build -t immich-auto-stack:patch-1 .
  3. Edit compose:
    1. in docker-compose for immich-auto-stack, change:
    2. image: ghcr.io/tenekev/immich-auto-stack:latest
    3. to
    4. image: immich-auto-stack:patch-1
    5. This references the image you've built locally instead of a remote image
  4. Restart the docker container
    1. docker compose up -d

My compose file:

  immich-auto-stack:
    container_name: immich-auto-stack
    image: immich-auto-stack:patch-1 #temp replacement while the original dev updates it for recent immich support #ghcr.io/tenekev/immich-auto-stack:latest
    restart: unless-stopped 
    ....rest of docker-compose.yml

skylatian avatar Sep 30 '24 23:09 skylatian

Alternatively (for simplicity's sake), you could download @Majorfi's immich_auto_stack.py file and just run that through a terminal command (or on a schedule) in your existing docker container (personally, I mapped a new "temporary" directory and am running this script manually in the interim when needed).

ste7enm avatar Oct 01 '24 16:10 ste7enm

You don't have to manually check it out, you can just do the following change in your compose:

  immich-auto-stack:
    container_name: immich-auto-stack
    #image: ghcr.io/tenekev/immich-auto-stack:latest
    build: https://github.com/Majorfi/immich-auto-stack.git#d039ac39346c2fc758799636e3ca5ffff878d18e
...

(I refer the commit to be on the safe side, but you could also use #patch-1 in the url)

and then run docker compose build immich-auto-stack instead of docker compose pull immich-auto-stack before starting the container with docker compose up immich-auto-stack

chkuendig avatar Dec 21 '24 21:12 chkuendig

Thank you @chkuendig. Its working like a charm.

Handkep avatar Jan 02 '25 23:01 Handkep

@tenekev seems the rewrite is taking some time and this is a working fix. Could you reconsider accepting this PR to make your solution work again? :)

anoff avatar Jan 03 '25 14:01 anoff

This seems to break stuff like "motion photos". Instead of creating a stack of the raw + the jpeg (which is a "motion photo") it also includes the underlying mp4 in the stack which is normally not visible in immich. (Only via the play motion photo button)

belst avatar Jan 28 '25 22:01 belst

This seems to break stuff like "motion photos". Instead of creating a stack of the raw + the jpeg (which is a "motion photo") it also includes the underlying mp4 in the stack which is normally not visible in immich. (Only via the play motion photo button)

@belst Seems like searchAssets api includes encoded motion video in the search result. I did not find a way to exclude them from the result though.

edit: add "isVisible": True to payload when fetching assets solved the problem.

def fetchAssets(self, size: int = 1000) -> list:
    payload = {
        "size": size,
        "page": 1,
        # 'withExif': True,
        "withStacked": True,
+       "isVisible": True,
    }

xinyangli avatar Feb 18 '25 10:02 xinyangli

Thanks for the fix. But when I launch a search, by tags or others, the stacks disappear. Can this be changed?

keisersuze avatar Feb 25 '25 14:02 keisersuze

@keisersuze I don't think it's implemented in immich yet. See https://github.com/immich-app/immich/discussions/6387

xinyangli avatar Feb 25 '25 14:02 xinyangli

Just a general note: I’ve expanded this tool to better fit my needs and skill set, making it easier to build on top of. I’m working on a Go version, available here: https://github.com/Majorfi/immich-stack. It mimics the features of immich-auto-stack — not a full 1:1 port, but it’s been working great with my 13k photo library!

And docker available 🎊

Majorfi avatar May 03 '25 18:05 Majorfi