mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
Move ping code
This commit is contained in:
parent
124b3bdde1
commit
e2bbf61866
1 changed files with 8 additions and 9 deletions
|
@ -120,6 +120,14 @@ class Service(object):
|
||||||
|
|
||||||
# If an item is playing
|
# If an item is playing
|
||||||
if self.kodi_player.isPlaying():
|
if self.kodi_player.isPlaying():
|
||||||
|
# ping metrics server to keep sessions alive while playing
|
||||||
|
# ping every 5 min
|
||||||
|
timeSinceLastPing = time.time() - self.lastMetricPing
|
||||||
|
if(timeSinceLastPing > 300):
|
||||||
|
self.lastMetricPing = time.time()
|
||||||
|
ga = GoogleAnalytics()
|
||||||
|
ga.sendEventData("PlayAction", "PlayPing")
|
||||||
|
|
||||||
self._report_progress()
|
self._report_progress()
|
||||||
|
|
||||||
elif not self.startup:
|
elif not self.startup:
|
||||||
|
@ -140,15 +148,6 @@ class Service(object):
|
||||||
# or Kodi is shut down.
|
# or Kodi is shut down.
|
||||||
self._server_online_check()
|
self._server_online_check()
|
||||||
|
|
||||||
# ping metrics server to keep sessions alive while playing
|
|
||||||
# ping every 5 min
|
|
||||||
timeSinceLastPing = time.time() - self.lastMetricPing
|
|
||||||
if(timeSinceLastPing > 300):
|
|
||||||
self.lastMetricPing = time.time()
|
|
||||||
if self.kodi_player.isPlaying():
|
|
||||||
ga = GoogleAnalytics()
|
|
||||||
ga.sendEventData("PlayAction", "PlayPing")
|
|
||||||
|
|
||||||
if self.monitor.waitForAbort(1):
|
if self.monitor.waitForAbort(1):
|
||||||
# Abort was requested while waiting. We should exit
|
# Abort was requested while waiting. We should exit
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue