remove_old() fix
Was not removing older playlists.
This commit is contained in:
@ -23,9 +23,9 @@ plex = PlexServer(PLEX_URL, PLEX_TOKEN)
|
|||||||
def remove_old():
|
def remove_old():
|
||||||
# Remove old Aired Today Playlists
|
# Remove old Aired Today Playlists
|
||||||
for playlist in plex.playlists():
|
for playlist in plex.playlists():
|
||||||
if playlist.title == TODAY_PLAY_TITLE.startswith('Aired Today') and not TODAY_PLAY_TITLE:
|
if playlist.title.startswith('Aired Today') and playlist.title != TODAY_PLAY_TITLE:
|
||||||
requests.delete('{}/playlists/{}?X-Plex-Token={}'.format(PLEX_URL, TODAY_PLAY_TITLE, PLEX_TOKEN))
|
playlist.delete()
|
||||||
print('Removing old Aired Today Playlists')
|
print('Removing old Aired Today Playlists: {}'.format(playlist.title))
|
||||||
elif playlist.title == TODAY_PLAY_TITLE:
|
elif playlist.title == TODAY_PLAY_TITLE:
|
||||||
print('{} already exists. No need to make again.'.format(TODAY_PLAY_TITLE))
|
print('{} already exists. No need to make again.'.format(TODAY_PLAY_TITLE))
|
||||||
exit(0)
|
exit(0)
|
||||||
|
Reference in New Issue
Block a user