Simplify set marker in database

This commit is contained in:
JonnyWong16 2023-02-16 17:06:46 -08:00
parent 599c54c9e1
commit 7cc78d448d
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -661,15 +661,10 @@ class ActivityProcessor(object):
[session['write_attempts'] + 1, session_key])
def set_marker(self, session_key=None, marker_idx=None, marker_type=None):
if marker_type == 'intro':
args = [1, 0]
elif marker_type == 'credits':
args = [0, 1]
else:
args = [0, 0]
marker_args = [int(marker_type == 'intro'), int(marker_type == 'credits')]
self.db.action('UPDATE sessions SET intro = ?, credits = ?, marker = ? '
'WHERE session_key = ?',
args + [marker_idx, session_key])
marker_args + [marker_idx, session_key])
def set_watched(self, session_key=None):
self.db.action('UPDATE sessions SET watched = ? '