docker-makemkv icon indicating copy to clipboard operation
docker-makemkv copied to clipboard

Add report script feature to GUI

Open Papierkorb opened this issue 2 years ago • 5 comments

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!

Papierkorb avatar Jun 28 '23 09:06 Papierkorb

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 ?

jlesage avatar Aug 03 '23 11:08 jlesage

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

Papierkorb avatar Aug 03 '23 11:08 Papierkorb

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

jlesage avatar Aug 03 '23 12:08 jlesage

Nope, just those four cases the shell script figures out

Papierkorb avatar Aug 03 '23 12:08 Papierkorb

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

silentnyte avatar Mar 25 '24 20:03 silentnyte