Skip to content

Conversation

@Papierkorb
Copy link

Hello!

For a project I'm building I needed a good way of knowing when ripping has finished. As I'm using the MakeMKV GUI I added a report feature that calls a script of the users choosing with a bunch of env vars for each log event.

I tried to update the appdefs.yml, but don't know how to generate the README.md.

I hope this is useful for other users! What's missing is an autoripper integration, however I think it shouldn't be that hard to add (maybe using the same protocol?)

Cheers!

@jlesage
Copy link
Owner

jlesage commented Aug 3, 2023

Thanks for this. To better align with what would be done by the automatic disc ripper, I was wondering if invoking the script for every "code" is useful/needed. Would it be still useful to invoke the script only in particular cases, like when the rip starts and finishes ?

@Papierkorb
Copy link
Author

Hello,

You're right, as I do the filtering in the script to decide what to do with the event. This is because

  1. I couldn't find the list of codes so I just wanted to log them first to figure them out
  2. It's much easier to change a script in a docker mount than recompiling/docker-create-ing the app

However, I did not notice any performance issues using a script like this:

#!/bin/sh

echo "$(date)   ${MAKEMKV_CODE} ${MAKEMKV_PATH} ${MAKEMKV_TEXT}" >> "/config/log/makemkv-$(date +%Y-%m-%d).log"

State=""
Path="${MAKEMKV_PATH#/output/}"

# Translate code to word
case "$MAKEMKV_CODE" in
  5011)
    State="READY"
    ;;
  5014)
    State="RIPPING"
    ;;
  5036)
    State="DONE"
    ;;
  5037)
    State="ERROR"
    ;;
  *)
    exit 0
    ;;
esac

# Off it goes!
echo "{\"state\":\"${State}\",\"path\":\"${Path}\"}" | mosquitto_pub ... -t home/makemkv/0 -s -r

I use that script to integrate MakeMKV into HomeAssistant and into a custom tool for post-processing. Works great

@jlesage
Copy link
Owner

jlesage commented Aug 3, 2023

So in your use case do you need more than start and finish (with result) events ?

@Papierkorb
Copy link
Author

Nope, just those four cases the shell script figures out

@silentnyte
Copy link

Curious on what the status of this is? I would love to use this feature as part of an auto ripper.

@jlesage
Copy link
Owner

jlesage commented Feb 9, 2025

Support for hooks is now available. Thanks @Papierkorb for this PR, I've been able to build on top on this to implement the hooks.

@jlesage jlesage closed this Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants