implement create custom playlist, #733
This commit is contained in:
parent
87cf9fdd53
commit
f85772ca14
|
|
@ -1,5 +1,7 @@
|
|||
"""all playlist API views"""
|
||||
|
||||
import uuid
|
||||
|
||||
from common.views_base import AdminWriteOnly, ApiBaseView
|
||||
from download.src.subscriptions import PlaylistSubscription
|
||||
from playlist.src.index import YoutubePlaylist
|
||||
|
|
@ -45,6 +47,13 @@ class PlaylistApiListView(ApiBaseView):
|
|||
print(message)
|
||||
return Response({"message": message}, status=400)
|
||||
|
||||
custom_name = data["data"].get("create")
|
||||
if custom_name:
|
||||
playlist_id = f"TA_playlist_{uuid.uuid4()}"
|
||||
custom_playlist = YoutubePlaylist(playlist_id)
|
||||
custom_playlist.create(custom_name)
|
||||
return Response(custom_playlist.json_data)
|
||||
|
||||
pending = []
|
||||
for playlist_item in to_add:
|
||||
playlist_id = playlist_item["playlist_id"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue