mirror of
https://github.com/gordielachance/plugin.audio.subsonic
synced 2025-01-07 13:51:53 +01:00
Notify service start
This commit is contained in:
parent
57141eed02
commit
0932e650f8
10
service.py
10
service.py
@ -58,15 +58,16 @@ def scrobble_track(track_id):
|
|||||||
res = connection.scrobble(track_id)
|
res = connection.scrobble(track_id)
|
||||||
#xbmc.log("response %s"%(res), xbmc.LOGINFO)
|
#xbmc.log("response %s"%(res), xbmc.LOGINFO)
|
||||||
if res['status'] == 'ok':
|
if res['status'] == 'ok':
|
||||||
popup('Scrobbled track')
|
popup("Scrobbled track")
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
popup('Scrobble failed')
|
popup("Scrobble failed")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
monitor = xbmc.Monitor()
|
monitor = xbmc.Monitor()
|
||||||
xbmc.log("Service started", xbmc.LOGINFO)
|
xbmc.log("Subsonic service started", xbmc.LOGINFO)
|
||||||
|
popup("Subsonic service started")
|
||||||
while not monitor.abortRequested():
|
while not monitor.abortRequested():
|
||||||
if monitor.waitForAbort(10):
|
if monitor.waitForAbort(10):
|
||||||
break
|
break
|
||||||
@ -89,8 +90,9 @@ if __name__ == '__main__':
|
|||||||
pass
|
pass
|
||||||
except IndexError:
|
except IndexError:
|
||||||
print ("Not a Subsonic track")
|
print ("Not a Subsonic track")
|
||||||
|
scrobbled = True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
xbmc.log("Script failed %e"%e, xbmc.LOGINFO)
|
xbmc.log("Subsonic service failed %e"%e, xbmc.LOGINFO)
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
#xbmc.log("Playing stopped", xbmc.LOGINFO)
|
#xbmc.log("Playing stopped", xbmc.LOGINFO)
|
||||||
|
Loading…
Reference in New Issue
Block a user