From 7cc78d448d6d3f907d203203be0d20d2a359f275 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Thu, 16 Feb 2023 17:06:46 -0800 Subject: [PATCH] Simplify set marker in database --- plexpy/activity_processor.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/plexpy/activity_processor.py b/plexpy/activity_processor.py index c821d23d..dcd1f138 100644 --- a/plexpy/activity_processor.py +++ b/plexpy/activity_processor.py @@ -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 = ? '