% import datetime import plexpy from plexpy import activity_handler, helpers if queue == 'active sessions': filter_key = 'session_key-' title_format = '{2} / {1} ({0})' title_key = title_format.format('Session Key', 'Title', 'User') description = 'Queue to flush stuck active sessions to the database.' else: filter_key = 'rating_key-' title_format = '{1} ({0})' title_key = title_format.format('Rating Key', 'Title') description = 'Queue to flush recently added items to the database and send notifications if enabled.' scheduled_jobs = [j.id for j in activity_handler.ACTIVITY_SCHED.get_jobs() if j.id.startswith(filter_key)] %>