Exemple #1
0
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'])
Exemple #2
0
 def delete(identifier):
     return {'message': 'Playlist has been removed.', 'data': Controller.delete_playlist(identifier)}, 200