fscorrupt / Posterizarr

🖼️ Automated poster maker for Plex/Jellyfin/Emby.
107 stars 10 forks source link

[FR] Ability to mount docker.sock and run commands against other docker containers #116

Closed jacobrreed closed 4 months ago

jacobrreed commented 4 months ago

Right now im using the Tautulli docker mode script, so that when a new movie is added, it calls the trigger.py to make posterizarr generate a poster for that one movie or show. What I would like is after that is done, for posterizarr to be able to call an overlay only run on Kometa (Plex Meta Manager) so that the overlays update with new poster, Kometa doesnt do single runs against one movie, but I think just running overlays would suffice.

Describe the solution you'd like For this to work I think you'd have to allow docker.sock to be mounted, docker cli installed in the image itself maybe, then some form of dumping a script into a scripts folder for posterizarr to run with a trigger

Describe alternatives you've considered Not sure of others way

Additional context Add any other context or screenshots about the feature request here.

fscorrupt commented 4 months ago

i added docker-cli to the dev image, please try it with this and report back if it works for you, you still have to mount the docker.sock tho -v /var/run/docker.sock:/var/run/docker.sock

image: ghcr.io/fscorrupt/docker-posterizarr-dev:latest

jacobrreed commented 4 months ago

Ok I'll investigate thanks

fscorrupt commented 4 months ago

you could then place a script inside the posterizarr config dir with such a content

$containerName = "kometa"
$command = "python", "kometa.py", "-ov", "-is", "-r", "-l", "OverlayTest"

# Execute the command inside the Docker container
docker exec -it $containerName $command

then you are able to call it from anywhere with:

docker exec -it posterizarr pwsh ./config/YOURSCRIPT.ps1

jacobrreed commented 4 months ago

how would I get this working with tautulli script, I want it so that the tautulli script runs (which creates that file in posterizarr to pickup to create poster for newly added items), then after that script runs I want it to call the above script

jacobrreed commented 4 months ago

Essentially I guess there should be something similar to how the tautulli scripts works, where it creates a file or something for posterizarr to pickup and run, i.e the script could write to a file called like "update-kometa-overlays.posterizarr" and posterizarr would watch and see that, run the command (which calls the docker exec to run overlays) then delete the file, similar to how to it works with the tautulli script

fscorrupt commented 4 months ago

You would need to update the trigger.py to add the docker exec command, best would be with an sleep/wait of a minute or two then posterizarr would create the poster in meantime and tautulli then triggers the docker exec, but in posterizarr there is currently no way of doing this, i will add the function when kometa has it integrated.

jacobrreed commented 4 months ago

ya I wish Kometa had the ability to trigger a single overlay update

jacobrreed commented 4 months ago

ok well i will close this, I discussed with kometa team and its not something they'll probably ever do