mirror of
				https://github.com/Jonny007-MKD/OTR-DecodeAll
				synced 2025-11-03 16:15:36 +01:00 
			
		
		
		
	Renamed XBMC to Kodi (2nd)
This commit is contained in:
		
							parent
							
								
									a2f62dd3d4
								
							
						
					
					
						commit
						be17e21b0a
					
				
					 1 changed files with 6 additions and 6 deletions
				
			
		
							
								
								
									
										12
									
								
								otrDecodeAll
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								otrDecodeAll
									
									
									
									
									
								
							| 
						 | 
					@ -11,7 +11,7 @@ logMsgTypes=("      " "error" "warn" "info" "debug" "debugV")
 | 
				
			||||||
logMsgColor=("\033[37m" "\033[31m" "\033[33m" "\033[37m" "\033[37m" "\033[37m")
 | 
					logMsgColor=("\033[37m" "\033[31m" "\033[33m" "\033[37m" "\033[37m" "\033[37m")
 | 
				
			||||||
logLevel=0
 | 
					logLevel=0
 | 
				
			||||||
echoLevel=5
 | 
					echoLevel=5
 | 
				
			||||||
lastXbmcCheck=0
 | 
					lastKodiCheck=0
 | 
				
			||||||
umask 0002				# Set permissions 775/664 per default
 | 
					umask 0002				# Set permissions 775/664 per default
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -70,21 +70,21 @@ function funcPerformChecks {
 | 
				
			||||||
		exit 1
 | 
							exit 1
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	funcPerformXbmcCheck
 | 
						funcPerformKodiCheck
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function funcPerformXbmcCheck {
 | 
					function funcPerformKodiCheck {
 | 
				
			||||||
	local curTimestamp;
 | 
						local curTimestamp;
 | 
				
			||||||
	if [ $forceRun -eq 0 ] && [ -n "$kodiUrl" ]; then			# If we can and have to check whether Kodi 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-$lastKodiCheck)) -gt 10 ]; then	# Only check all 10 seconds
 | 
				
			||||||
			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]')"
 | 
								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 "Kodi is running, exiting now"
 | 
									funcLog 3 "Kodi is running, exiting now"
 | 
				
			||||||
				funcUnlock
 | 
									funcUnlock
 | 
				
			||||||
				exit
 | 
									exit
 | 
				
			||||||
			fi
 | 
								fi
 | 
				
			||||||
			lastXbmcCheck=$curTimestamp
 | 
								lastKodiCheck=$curTimestamp
 | 
				
			||||||
			funcLog 5 "Kodi is not running"
 | 
								funcLog 5 "Kodi is not running"
 | 
				
			||||||
		fi
 | 
							fi
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
| 
						 | 
					@ -282,7 +282,7 @@ function funcMakeVars {
 | 
				
			||||||
function funcProcessFiles {
 | 
					function funcProcessFiles {
 | 
				
			||||||
	local files="`ls $inDir/*.otrkey 2> /dev/null `"					# All otrkeys
 | 
						local files="`ls $inDir/*.otrkey 2> /dev/null `"					# All otrkeys
 | 
				
			||||||
	for file in $files; do												# For each otrkey
 | 
						for file in $files; do												# For each otrkey
 | 
				
			||||||
		funcPerformXbmcCheck
 | 
							funcPerformKodiCheck					# Check whether Kodi is running
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		filename="$(basename $file)"
 | 
							filename="$(basename $file)"
 | 
				
			||||||
		filename="${filename%.otrkey}"
 | 
							filename="${filename%.otrkey}"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue