def create_session(self, session_key, state):
        """
        :type session_key: str
        :type state: str

        :rtype: WatchSession or None
        """

        Log.Debug('Creating a WatchSession for the current media')

        video_section = PMS.get_video_session(session_key)
        if not video_section:
            return None

        player_section = video_section.findall('Player')
        if len(player_section):
            player_section = player_section[0]

        session = WatchSession.from_section(
            video_section, state,
            PlexMediaServer.metadata(video_section.get('ratingKey')),
            PlexMediaServer.client(player_section.get('machineIdentifier'))
        )
        session.save()

        return session
    def create_session(self, session_key, state):
        """
        :type session_key: str
        :type state: str

        :rtype: WatchSession or None
        """

        Log.Debug('Creating a WatchSession for the current media')

        video_section = PMS.get_video_session(session_key)
        if not video_section:
            return None

        player_section = video_section.findall('Player')
        if len(player_section):
            player_section = player_section[0]

        session = WatchSession.from_section(
            video_section, state,
            PlexMediaServer.metadata(video_section.get('ratingKey')),
            PlexMediaServer.client(player_section.get('machineIdentifier')))
        session.save()

        return session
 def create_session(self, info):
     return WatchSession.from_info(
         info,
         PlexMediaServer.metadata(info['ratingKey']),
         PlexMediaServer.client(info.get('client_id'))
     )
Example #4
0
 def create_session(self, info):
     return WatchSession.from_info(
         info, PlexMediaServer.metadata(info['ratingKey']),
         PlexMediaServer.client(info.get('client_id')))