Add report script feature to GUI
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!
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 ?
Hello,
You're right, as I do the filtering in the script to decide what to do with the event. This is because
- I couldn't find the list of codes so I just wanted to log them first to figure them out
- 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
So in your use case do you need more than start and finish (with result) events ?
Nope, just those four cases the shell script figures out
Curious on what the status of this is? I would love to use this feature as part of an auto ripper.