platypush/plugins/media/plex/__init__.py
def play(self, client=None, chromecast=None, **kwargs):
        """
        Search and play content on a client or a Chromecast. If no search filter
        is specified, a play event will be sent to the specified client.

        NOTE: Adding and managing play queues through the Plex API isn't fully
        supported yet, therefore in case multiple items are returned from the
        search only the first one will be played.

        :param client: Client name
        :type client: str

        :param chromecast: Chromecast name
        :type chromecast: str

        :param kwargs: Search filter (e.g. title, section, unwatched, director etc.)
        :type kwargs: dict
        """

        if not client and not chromecast:
            raise RuntimeError('No client nor chromecast specified')

        if client:
            client = self.plex.client(client)
        elif chromecast:
            (chromecast, handler) = self.get_chromecast(chromecast)

        if not kwargs:
            if client:
                return client.play()
            elif chromecast:
                return handler.play()

        if 'section' in kwargs:
            library = self.plex.library.section(kwargs.pop('section'))
        else:
            library = self.plex.library

        results = library.search(**kwargs)
        if not results:
            self.logger.info('No results for {}'.format(kwargs))
            return

        item = results[0]
        self.logger.info('Playing {} on {}'.format(item.title, client or chromecast))

        if client:
            return client.playMedia(item)
        elif chromecast:
            return handler.play_media(item, self.plex)

        Search and play content on a client or a Chromecast. If no search filter
        is specified, a play event will be sent to the specified client.

        NOTE: Adding and managing play queues through the Plex API isn't fully
        supported yet, therefore in case multiple items are returned from the
        search only the first one will be played.

        :param client: Client name
        :type client: str

        :param chromecast: Chromecast name
        :type chromecast: str

        :param kwargs: Search filter (e.g. title, section, unwatched, director etc.)
        :type kwargs: dict
        
Search and play content on a client or a Chromecast. If no search filter
is specified, a play event will be sent to the specified client.

Adding and managing play queues through the Plex API isn't fully
supported yet, therefore in case multiple items are returned from the
search only the first one will be played.
Search and play content on a client or a Chromecast . If no search filter is specified a play event will be sent to the specified client . Adding and managing play queues through the Plex API isn ' t fully supported yet therefore in case multiple items are returned from the search only the first one will be played .
def play(self, client=None, chromecast=None, **kwargs):
        if not client and not chromecast:
            raise RuntimeError('No client nor chromecast specified')
        if client:
            client = self.plex.client(client)
        elif chromecast:
            (chromecast, handler) = self.get_chromecast(chromecast)
        if not kwargs:
            if client:
                return client.play()
            elif chromecast:
                return handler.play()
        if 'section' in kwargs:
            library = self.plex.library.section(kwargs.pop('section'))
        else:
            library = self.plex.library
        results = library.search(**kwargs)
        if not results:
            self.logger.info('No results for {}'.format(kwargs))
            return
        item = results[0]
        self.logger.info('Playing {} on {}'.format(item.title, client or chromecast))
        if client:
            return client.playMedia(item)
        elif chromecast:
            return handler.play_media(item, self.plex)
def play ( self , client = None , chromecast = None , ** kwargs ) : if not client and not chromecast : raise RuntimeError ( 'No client nor chromecast specified' ) if client : client = self . plex . client ( client ) elif chromecast : ( chromecast , handler ) = self . get_chromecast ( chromecast ) if not kwargs : if client : return client . play ( ) elif chromecast : return handler . play ( ) if 'section' in kwargs : library = self . plex . library . section ( kwargs . pop ( 'section' ) ) else : library = self . plex . library results = library . search ( ** kwargs ) if not results : self . logger . info ( 'No results for {}' . format ( kwargs ) ) return item = results [ 0 ] self . logger . info ( 'Playing {} on {}' . format ( item . title , client or chromecast ) ) if client : return client . playMedia ( item ) elif chromecast : return handler . play_media ( item , self . plex )
Search and play content on a client or a Chromecast.
Search and play content on a client or a Chromecast .
"""
        Search and play content on a client or a Chromecast. If no search filter
        is specified, a play event will be sent to the specified client.

        NOTE: Adding and managing play queues through the Plex API isn't fully
        supported yet, therefore in case multiple items are returned from the
        search only the first one will be played.

        :param client: Client name
        :type client: str

        :param chromecast: Chromecast name
        :type chromecast: str

        :param kwargs: Search filter (e.g. title, section, unwatched, director etc.)
        :type kwargs: dict
        """
self
client
None
chromecast
None
kwargs
None