Remove code to update view offset for every websocket event

This commit is contained in:
Florian Böhm 2018-10-06 11:01:13 +02:00 committed by GitHub
parent af3944734f
commit 40559471cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,7 +228,6 @@ class ActivityHandler(object):
this_state = self.timeline['state']
this_rating_key = str(self.timeline['ratingKey'])
this_key = self.timeline['key']
this_view_offset = self.timeline['viewOffset']
# Get the live tv session uuid
this_live_uuid = this_key.split('/')[-1] if this_key.startswith('/livetv/sessions') else None
@ -242,7 +241,6 @@ class ActivityHandler(object):
last_state = db_session['state']
last_rating_key = str(db_session['rating_key'])
last_live_uuid = db_session['live_uuid']
last_view_offset = db_session['view_offset']
# Make sure the same item is being played
if this_rating_key == last_rating_key or this_live_uuid == last_live_uuid:
@ -253,10 +251,6 @@ class ActivityHandler(object):
if int(time.time()) - db_session['stopped'] > 60:
self.update_db_session()
# Update db session when view offset changes
if this_view_offset != last_view_offset:
self.update_db_session()
# Start our state checks
if this_state != last_state:
if this_state == 'paused':