def create(cls, server, item, shuffle=0, repeat=0, includeChapters=1, includeRelated=1):
        """ Create and returns a new :class:`~plexapi.playqueue.PlayQueue`.

            Paramaters:
                server (:class:`~plexapi.server.PlexServer`): Server you are connected to.
                item (:class:`~plexapi.media.Media` or class:`~plexapi.playlist.Playlist`): A media or Playlist.
                shuffle (int, optional): Start the playqueue shuffled.
                repeat (int, optional): Start the playqueue shuffled.
                includeChapters (int, optional): include Chapters.
                includeRelated (int, optional): include Related.
        """
        args = {}
        args['includeChapters'] = includeChapters
        args['includeRelated'] = includeRelated
        args['repeat'] = repeat
        args['shuffle'] = shuffle
        if item.type == 'playlist':
            args['playlistID'] = item.ratingKey
            args['type'] = item.playlistType
        else:
            uuid = item.section().uuid
            args['key'] = item.key
            args['type'] = item.listType
            args['uri'] = 'library://%s/item/%s' % (uuid, item.key)
        path = '/playQueues%s' % utils.joinArgs(args)
        data = server.query(path, method=server._session.post)
        c = cls(server, data, initpath=path)
        # we manually add a key so we can pass this to playMedia
        # since the data, does not contain a key.
        c.key = item.key
        return c
def create ( cls , server , item , shuffle = 0 , repeat = 0 , includeChapters = 1 , includeRelated = 1 ) : args = { } args [ 'includeChapters' ] = includeChapters args [ 'includeRelated' ] = includeRelated args [ 'repeat' ] = repeat args [ 'shuffle' ] = shuffle if item . type == 'playlist' : args [ 'playlistID' ] = item . ratingKey args [ 'type' ] = item . playlistType else : uuid = item . section ( ) . uuid args [ 'key' ] = item . key args [ 'type' ] = item . listType args [ 'uri' ] = 'library://%s/item/%s' % ( uuid , item . key ) path = '/playQueues%s' % utils . joinArgs ( args ) data = server . query ( path , method = server . _session . post ) c = cls ( server , data , initpath = path ) c . key = item . key return c
Create and returns a new :class:`~plexapi.playqueue.PlayQueue`.

            Paramaters:
                server (:class:`~plexapi.server.PlexServer`): Server you are connected to.
                item (:class:`~plexapi.media.Media` or class:`~plexapi.playlist.Playlist`): A media or Playlist.
                shuffle (int, optional): Start the playqueue shuffled.
                repeat (int, optional): Start the playqueue shuffled.
                includeChapters (int, optional): include Chapters.
                includeRelated (int, optional): include Related.