move custom id creation to view
This commit is contained in:
parent
4a8e04c0fc
commit
b68972189b
|
@ -5,7 +5,6 @@ functionality:
|
|||
"""
|
||||
|
||||
import json
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from home.src.download.thumbnails import ThumbManager
|
||||
|
@ -25,9 +24,7 @@ class YoutubePlaylist(YouTubeItem):
|
|||
}
|
||||
yt_base = "https://www.youtube.com/playlist?list="
|
||||
|
||||
def __init__(self, youtube_id=None):
|
||||
if youtube_id is None:
|
||||
youtube_id = "TA_playlist_" + str(uuid.uuid4())
|
||||
def __init__(self, youtube_id):
|
||||
super().__init__(youtube_id)
|
||||
self.all_members = False
|
||||
self.nav = False
|
||||
|
|
|
@ -6,6 +6,7 @@ Functionality:
|
|||
|
||||
import enum
|
||||
import urllib.parse
|
||||
import uuid
|
||||
from time import sleep
|
||||
|
||||
from api.src.search_processor import SearchProcess, process_aggs
|
||||
|
@ -847,7 +848,8 @@ class PlaylistView(ArchivistResultsView):
|
|||
create_form = CreatePlaylistForm(data=request.POST)
|
||||
if create_form.is_valid():
|
||||
name = request.POST.get("create")
|
||||
YoutubePlaylist().create(name)
|
||||
playlist_id = f"TA_playlist_{uuid.uuid4()}"
|
||||
YoutubePlaylist(playlist_id).create(name)
|
||||
else:
|
||||
subscribe_form = SubscribeToPlaylistForm(data=request.POST)
|
||||
if subscribe_form.is_valid():
|
||||
|
|
Loading…
Reference in New Issue