Don't start service if scrobbling switched off

This commit is contained in:
warwickh 2021-09-10 09:24:48 +10:00
parent 8ca52e6cc8
commit f97b9e1de9
1 changed files with 20 additions and 18 deletions

View File

@ -69,6 +69,7 @@ def scrobble_track(track_id):
return False return False
if __name__ == '__main__': if __name__ == '__main__':
if(scrobbleEnabled):
monitor = xbmc.Monitor() monitor = xbmc.Monitor()
xbmc.log("Subsonic service started", xbmc.LOGINFO) xbmc.log("Subsonic service started", xbmc.LOGINFO)
popup("Subsonic service started") popup("Subsonic service started")
@ -77,7 +78,7 @@ if __name__ == '__main__':
break break
if (xbmc.getCondVisibility("Player.HasMedia")): if (xbmc.getCondVisibility("Player.HasMedia")):
try: try:
if(scrobbleEnabled):
currentFileName = xbmc.getInfoLabel("Player.Filenameandpath") currentFileName = xbmc.getInfoLabel("Player.Filenameandpath")
currentFileProgress = xbmc.getInfoLabel("Player.Progress") currentFileProgress = xbmc.getInfoLabel("Player.Progress")
pattern = re.compile(r'plugin:\/\/plugin\.audio\.subsonic\/\?action=play_track&id=(.*?)&') pattern = re.compile(r'plugin:\/\/plugin\.audio\.subsonic\/\?action=play_track&id=(.*?)&')
@ -100,4 +101,5 @@ if __name__ == '__main__':
else: else:
pass pass
#xbmc.log("Playing stopped", xbmc.LOGINFO) #xbmc.log("Playing stopped", xbmc.LOGINFO)
else:
xbmc.log("Subsonic service not started due to settings", xbmc.LOGINFO)