Ejemplo n.º 1
0
def create_playlist():
    request_data = request.get_json()
    playlistname = request_data['name']
    section = request_data['section']
    d = Playlist(server=plex, data=None)
    d.create(server=plex,
             title=f"{playlistname}",
             smart=True,
             section=f"{section}")
    return "playlist created successfully"
Ejemplo n.º 2
0
 def loads(cls,
           playlist_data: str,
           track_data: Collection[str],
           plex: 'LocalPlexServer' = None) -> 'PlexPlaylist':
     plex = _get_plex(plex)
     playlist = Playlist(plex.server,
                         fromstring(playlist_data.encode('utf-8')))
     playlist._items = [
         Track(plex.server, fromstring(td.encode('utf-8')))
         for td in track_data
     ]
     return cls(playlist.title, plex, playlist)