mirror of
				https://github.com/Jonny007-MKD/OTR-DecodeAll
				synced 2025-11-03 16:15:36 +01:00 
			
		
		
		
	Renamed XBMC to Kodi
This commit is contained in:
		
							parent
							
								
									e7244596ec
								
							
						
					
					
						commit
						c89dc512f0
					
				
					 2 changed files with 8 additions and 8 deletions
				
			
		
							
								
								
									
										2
									
								
								config
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								config
									
									
									
									
									
								
							| 
						 | 
					@ -13,7 +13,7 @@ function funcConfigPre {	# These values are set at the beginning of the script
 | 
				
			||||||
	outDir="/Multimedia/Video/"										# Final dir with videos
 | 
						outDir="/Multimedia/Video/"										# Final dir with videos
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	torrentDb="/home/deluged/torrents.db"							# File with file names and labels (see at github: OTR-TorrentDb)
 | 
						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 Kodi JSON API (HTTP interface)
 | 
						kodiUrl="user:password@localhost:8080"							# Specify user, password and port for Kodi JSON API (HTTP interface)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	logFile="/home/deluged/otrDecodeAll.log"						# path to the log file
 | 
						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
 | 
						# log levels:	0=off; 1=error; 2=warn; 3=info; 4 debug; 5 verbose debug
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										14
									
								
								otrDecodeAll
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								otrDecodeAll
									
									
									
									
									
								
							| 
						 | 
					@ -61,8 +61,8 @@ function funcPerformChecks {
 | 
				
			||||||
		funcLog 1 "Please check the path to SaneRenamix (set to empty if not wanted)"
 | 
							funcLog 1 "Please check the path to SaneRenamix (set to empty if not wanted)"
 | 
				
			||||||
		exet=1
 | 
							exet=1
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
	if [ -n "$xbmcUrl" ] && ! type "curl" >/dev/null 2>&1; then
 | 
						if [ -n "$kodiUrl" ] && ! type "curl" >/dev/null 2>&1; then
 | 
				
			||||||
		funcLog 1 "Please install curl to check the XBMC state"
 | 
							funcLog 1 "Please install curl to check the Kodi state"
 | 
				
			||||||
		exet=1
 | 
							exet=1
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
	if [ $exet -eq 1 ]; then
 | 
						if [ $exet -eq 1 ]; then
 | 
				
			||||||
| 
						 | 
					@ -75,17 +75,17 @@ function funcPerformChecks {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function funcPerformXbmcCheck {
 | 
					function funcPerformXbmcCheck {
 | 
				
			||||||
	local curTimestamp;
 | 
						local curTimestamp;
 | 
				
			||||||
	if [ $forceRun -eq 0 ] && [ -n "$xbmcUrl" ]; then			# If we can and have to check whether XBMC is playing something
 | 
						if [ $forceRun -eq 0 ] && [ -n "$kodiUrl" ]; then			# If we can and have to check whether Kodi is playing something
 | 
				
			||||||
		curTimestamp=$(date +%s)
 | 
							curTimestamp=$(date +%s)
 | 
				
			||||||
		if [ $(($curTimestamp-$lastXbmcCheck)) -gt 10 ]; then	# Only check all 10 seconds
 | 
							if [ $(($curTimestamp-$lastXbmcCheck)) -gt 10 ]; then	# Only check all 10 seconds
 | 
				
			||||||
			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]')"
 | 
								playerID="$(curl -s $kodiUrl/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
 | 
								if [ -n "$playerID" ]; then
 | 
				
			||||||
				funcLog 3 "XBMC is running, exiting now"
 | 
									funcLog 3 "Kodi is running, exiting now"
 | 
				
			||||||
				funcUnlock
 | 
									funcUnlock
 | 
				
			||||||
				exit
 | 
									exit
 | 
				
			||||||
			fi
 | 
								fi
 | 
				
			||||||
			lastXbmcCheck=$curTimestamp
 | 
								lastXbmcCheck=$curTimestamp
 | 
				
			||||||
			funcLog 5 "XBMC is not running"
 | 
								funcLog 5 "Kodi is not running"
 | 
				
			||||||
		fi
 | 
							fi
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -143,7 +143,7 @@ function funcParam {
 | 
				
			||||||
function funcHelp {
 | 
					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 -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 "-> FORCE"
 | 
				
			||||||
	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 -e "	\033[36m-f\033[37m Make this script ignore the lockfile and Kodi. This may result into decoding some files multiple times (perhaps corrupting them) and making Kodi less smooth."
 | 
				
			||||||
	echo "-> REMOVE"
 | 
						echo "-> REMOVE"
 | 
				
			||||||
	echo -e "	\033[36m-r\033[37m Make this script delete the original otrkey files."
 | 
						echo -e "	\033[36m-r\033[37m Make this script delete the original otrkey files."
 | 
				
			||||||
	echo "-> KEEP"
 | 
						echo "-> KEEP"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue