fix for -1 reference handling
This commit is contained in:
parent
13ebc8a1e8
commit
435f16b779
@ -103,14 +103,15 @@ def playlist():
|
|||||||
playlist_references = []
|
playlist_references = []
|
||||||
|
|
||||||
if request_json.get('playlist_references', None):
|
if request_json.get('playlist_references', None):
|
||||||
for i in request_json['playlist_references']:
|
if request_json['playlist_references'] != -1:
|
||||||
retrieved_ref = database.get_user_playlist_ref_by_user_ref(user_ref, i)
|
for i in request_json['playlist_references']:
|
||||||
if retrieved_ref:
|
retrieved_ref = database.get_user_playlist_ref_by_user_ref(user_ref, i)
|
||||||
playlist_references.append(retrieved_ref)
|
if retrieved_ref:
|
||||||
else:
|
playlist_references.append(retrieved_ref)
|
||||||
return jsonify({"message": f'managed playlist {i} not found', "status": "error"}), 400
|
else:
|
||||||
|
return jsonify({"message": f'managed playlist {i} not found', "status": "error"}), 400
|
||||||
|
|
||||||
if len(playlist_references) == 0:
|
if len(playlist_references) == 0 and request_json.get('playlist_references', None) != -1:
|
||||||
playlist_references = None
|
playlist_references = None
|
||||||
|
|
||||||
playlist_id = request_json.get('id', None)
|
playlist_id = request_json.get('id', None)
|
||||||
|
Loading…
Reference in New Issue
Block a user