From cc41e949a9785a966613099755251095a0276e46 Mon Sep 17 00:00:00 2001 From: aj Date: Mon, 10 Jun 2019 22:23:03 +0100 Subject: [PATCH] added ignore recent parts --- generateplaylists.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/generateplaylists.py b/generateplaylists.py index 0802791..d6bd6a7 100644 --- a/generateplaylists.py +++ b/generateplaylists.py @@ -53,9 +53,16 @@ if __name__ == '__main__': recent_parts = [] - for playlist in [i for i in data['playlists'] if 'include_in_recents' in i]: - if playlist['include_in_recents']: - recent_parts += [i for i in playlist['playlists']] + if 'use_marked_playlists' in data['recents']: + if data['recents']['use_marked_playlists']: + for playlist in [i for i in data['playlists'] if 'include_in_recents' in i]: + if playlist['include_in_recents']: + recent_parts += [i for i in playlist['playlists']] + + else: + for playlist in [i for i in data['playlists'] if 'include_in_recents' in i]: + if playlist['include_in_recents']: + recent_parts += [i for i in playlist['playlists']] if 'playlists' in data['recents']: recent_parts += data['recents']['playlists']