From f3389a1c2208bf3bf740b666f261abf1a229011a Mon Sep 17 00:00:00 2001 From: Blacktwin Date: Fri, 4 Jan 2019 13:41:44 -0500 Subject: [PATCH] check for libraries when they are needed fix update function --- fun/playlist_manager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fun/playlist_manager.py b/fun/playlist_manager.py index 81fa014..bd831ae 100644 --- a/fun/playlist_manager.py +++ b/fun/playlist_manager.py @@ -660,7 +660,11 @@ if __name__ == "__main__": delete_playlist(playlist_dict, opts.jbop) else: - keys_list, title = build_playlist(opts.jbop, libraries, opts.days, opts.top, filters, search) + if libraries: + keys_list, title = build_playlist(opts.jbop, libraries, opts.days, opts.top, filters, search) + else: + print('This function requires libraries to be listed.') + exit() # Check if limit exist and if it's greater than the pulled list of rating keys if opts.limit and len(keys_list) > int(opts.limit): @@ -678,6 +682,7 @@ if __name__ == "__main__": for x in plex_servers: playlist_dict['server'] = x['server'] playlist_dict['user'] = x['user'] + playlist_dict['user_playlists'] = x['user_playlists'] delete_playlist(playlist_dict, opts.jbop) print('Creating playlist(s)...') for x in plex_servers: