コード例 #1
0
ファイル: server.py プロジェクト: barrycarey/python-plexapi
    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)
コード例 #2
0
    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)
コード例 #3
0
ファイル: server.py プロジェクト: tetexxr/python-plexapi
    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)
コード例 #4
0
ファイル: playlist.py プロジェクト: dskrypa/music_manager
 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)
コード例 #5
0
ファイル: server.py プロジェクト: suavp/python-plexapi
 def createPlaylist(self, title, items):
     return Playlist.create(self, title, items)
コード例 #6
0
ファイル: server.py プロジェクト: logaritmisk/python-plexapi
 def createPlaylist(self, title, items):
     return Playlist.create(self, title, items)
コード例 #7
0
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")