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)
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)
def index(id): try: album = Album.get(id) return render_master_page("album.html", title="Album", album=album) except SQLObjectNotFound: abort(400)