1
0
Fork 0
mirror of https://github.com/Jonny007-MKD/OTR-DecodeAll synced 2024-05-02 20:54:06 +02:00

Introduced check whether XBMC is running. In this case we will simply exit

This commit is contained in:
Jonny007-MKD 2014-08-06 19:02:06 +02:00
parent 043337f9a2
commit dcb20d2641
2 changed files with 11 additions and 1 deletions

1
config
View file

@ -13,6 +13,7 @@ function funcConfigPre { # These values are set at the beginning of the script
outDir="/Multimedia/Video/" # Final dir with videos
torrentDb="/home/deluged/torrents.db" # File with file names and labels (see at github: OTR-TorrentDb)
xbmcUrl="user:password@localhost:8080" # Specify user, password and port for XBMC JSON API (HTTP interface)
logFile="/home/deluged/otrDecodeAll.log" # path to the log file
# log levels: 0=off; 1=error; 2=warn; 3=info; 4 debug; 5 verbose debug

View file

@ -61,6 +61,15 @@ function funcPerformChecks {
if [ $exet -eq 1 ]; then
exit 1
fi
if [ $forceRun -eq 0 ] && [ -n "$xbmcUrl" ]; then # If we can and have to check whether XBMC is playing something
playerID="$(curl -s $xbmcUrl/jsonrpc -H 'content-type: application/json;' --data-binary '{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}' | grep -o "[0-9],.type.:.$1" | grep -o '[0-9]')"
if [ -n "$playerID" ]; then
funcLog 3 "XBMC is running, exiting now"
funcUnlock
exit
fi
fi
}
@ -113,7 +122,7 @@ function funcParam {
function funcHelp {
echo -e "\n\033[1;31m./otrDecodeAll.sh [-f -k -v -h] [-e user] [-p password] [-i inputDir] [-d decodedDir] [-c delugeDir] [-o outputDir]\033[0;37m"
echo "-> FORCE"
echo -e " \033[36m-f\033[37m Make this script ignore the lockfile. This may result into decoding some files multiple times."
echo -e " \033[36m-f\033[37m Make this script ignore the lockfile and XBMC. This may result into decoding some files multiple times (perhaps corrupting them) and making XBMC less smooth."
echo "-> REMOVE"
echo -e " \033[36m-r\033[37m Make this script delete the original otrkey files."
echo "-> KEEP"