def ui_delete_playlist(identifier): # Get playlist info playlist = Controller.get_playlist(identifier) form = PlaylistForm(formdata=request.form) if playlist: if request.method == 'POST' and form.validate(): # Delete playlist Controller.delete_playlist(identifier) return redirect('/ui/playlists') return render_template('playlists/delete_playlist.html', id=playlist['id'], name=playlist['name'], youtube_id=playlist['youtube_id'], uploader=playlist['uploader'])
def delete(identifier): return {'message': 'Playlist has been removed.', 'data': Controller.delete_playlist(identifier)}, 200