Ability to stop a stream using session key
This commit is contained in:
@@ -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 = {}
|
||||
|
Reference in New Issue
Block a user