From 2ead141d0cee4a62c265e11b11e66fb143c4137a Mon Sep 17 00:00:00 2001 From: aj Date: Sat, 2 Nov 2019 11:44:24 +0000 Subject: [PATCH] removed requirement for parts or references in execute user added default sort enum type --- music/api/api.py | 13 ++++++------- music/model/playlist.py | 5 +++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/music/api/api.py b/music/api/api.py index 2f97bca..a69875e 100644 --- a/music/api/api.py +++ b/music/api/api.py @@ -484,15 +484,14 @@ def execute_user(username): logger.info(f'running {username}') for iterate_playlist in playlists: - if len(iterate_playlist.parts) > 0 or len(iterate_playlist.playlist_references) > 0: - if iterate_playlist.uri: + if iterate_playlist.uri: - if os.environ.get('DEPLOY_DESTINATION', None) == 'PROD': - create_run_user_playlist_task(username, iterate_playlist.name, seconds_delay) - else: - run_playlist(username, iterate_playlist.name) + if os.environ.get('DEPLOY_DESTINATION', None) == 'PROD': + create_run_user_playlist_task(username, iterate_playlist.name, seconds_delay) + else: + run_playlist(username, iterate_playlist.name) - seconds_delay += 6 + seconds_delay += 6 def create_run_user_playlist_task(username, playlist_name, delay=0): diff --git a/music/model/playlist.py b/music/model/playlist.py index b1cd4b6..26e689e 100644 --- a/music/model/playlist.py +++ b/music/model/playlist.py @@ -9,8 +9,9 @@ import music.db.database as database class Sort(Enum): - shuffle = 1 - release_date = 2 + default = 1 + shuffle = 2 + release_date = 3 class Playlist: