Ability to stop a stream using session key

This commit is contained in:
JonnyWong16 2018-06-05 20:30:07 -07:00
parent c18ee81130
commit 8c0bcd0059
6 changed files with 46 additions and 12 deletions

View file

@ -34,6 +34,7 @@ class ActivityProcessor(object):
def write_session(self, session=None, notify=True):
if session:
values = {'session_key': session.get('session_key', ''),
'session_id': session.get('session_id', ''),
'transcode_key': session.get('transcode_key', ''),
'section_id': session.get('section_id', ''),
'rating_key': session.get('rating_key', ''),
@ -466,6 +467,16 @@ class ActivityProcessor(object):
return None
def get_session_by_id(self, session_id=None):
if session_id:
session = self.db.select_single('SELECT * FROM sessions '
'WHERE session_id = ? ',
args=[session_id])
if session:
return session
return None
def set_session_state(self, session_key=None, state=None, **kwargs):
if str(session_key).isdigit():
values = {}