Temporary fix for live tv session missing duration

This commit is contained in:
JonnyWong16 2024-03-31 17:09:35 -07:00
parent 85519b1b45
commit b8185afdf9
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 4 additions and 2 deletions

View file

@ -163,7 +163,8 @@ class ActivityHandler(object):
# Set force_stop to true to disable the state set # Set force_stop to true to disable the state set
if not force_stop: if not force_stop:
# Set the view offset equal to the duration if it is within the last 10 seconds # Set the view offset equal to the duration if it is within the last 10 seconds
if self.db_session['duration'] - self.view_offset <= 10000: # TODO: temporary workaround for missing livetv duration
if self.db_session['duration'] > 0 and self.db_session['duration'] - self.view_offset <= 10000:
view_offset = self.db_session['duration'] view_offset = self.db_session['duration']
else: else:
view_offset = self.view_offset view_offset = self.view_offset

View file

@ -78,7 +78,8 @@ class ActivityProcessor(object):
'added_at': session.get('added_at', ''), 'added_at': session.get('added_at', ''),
'guid': session.get('guid', ''), 'guid': session.get('guid', ''),
'view_offset': session.get('view_offset', ''), 'view_offset': session.get('view_offset', ''),
'duration': session.get('duration', ''), # TODO: temporary workaround for missing livetv duration
'duration': session.get('duration', '') or 0,
'video_decision': session.get('video_decision', ''), 'video_decision': session.get('video_decision', ''),
'audio_decision': session.get('audio_decision', ''), 'audio_decision': session.get('audio_decision', ''),
'transcode_decision': session.get('transcode_decision', ''), 'transcode_decision': session.get('transcode_decision', ''),