def createPlaylist(self, title, items): """ Creates and returns a new :class:`~plexapi.playlist.Playlist`. Parameters: title (str): Title of the playlist to be created. items (list<Media>): List of media items to include in the playlist. """ return Playlist.create(self, title, items)
def createPlaylist(self, title, items=None, section=None, limit=None, smart=None, **kwargs): """ Creates and returns a new :class:`~plexapi.playlist.Playlist`. Parameters: title (str): Title of the playlist to be created. items (list<Media>): List of media items to include in the playlist. """ return Playlist.create(self, title, items=items, limit=limit, section=section, smart=smart, **kwargs)
def create(self, content: Tracks = None, **criteria): items = list(_get_tracks(self.plex, content, **criteria)) prefix = '[DRY RUN] Would create' if self.plex.dry_run else 'Creating' log.info(f'{prefix} {self} with {len(items):,d} tracks', extra={'color': 10}) log.debug(f'Creating {self} with tracks: {items}') if not self.plex.dry_run: self._playlist = Playlist.create(self.plex.server, self.name, items)
def createPlaylist(self, title, items): return Playlist.create(self, title, items)
import sys #PLEX INFO url = "http://192.168.1.#:32400" token = "##################" if hasattr(__builtins__, 'raw_input'): input=raw_input plex = PlexServer(url, token) for i, playlist in enumerate(plex.playlists()): print("{position}) {playlist_title}".format(position=i+1, playlist_title=playlist.title)) choice = -1 while choice == -1: selection = input("Select playlist: ") try: selection = int(selection) if selection > 0 and selection <= i+1: choice = selection - 1 else: print("Invalid selection") except: print("Invalid selection") new_playlist_name = input("Enter new playlist name: ") try: Playlist.create(plex, new_playlist_name, plex.playlists()[choice].items()) print("{playlist} created".format(playlist=new_playlist_name)) except: print("Error")