Example #1
0
def add_album_to_playlist(id):
    try:
        album = Album.get(id)
        for track in album.tracks:
            playlist.add_to_playlist(track.id)
        return redirect(request.headers['referer'])
    except LookupError:
        abort(400)
Example #2
0
def cover(id):
    try:
        album = Album.get(id)
        if not album.image:
            return redirect(url_for('.static', filename='images/nocover.png'))
        return send_file(album.image)
    except LookupError:
        abort(400)
Example #3
0
def index(id):
    try:
        album = Album.get(id)
        return render_master_page("album.html", title="Album", album=album)
    except SQLObjectNotFound:
        abort(400)