diff --git a/LyricsPy/app.py b/LyricsPy/app.py index 53f3c38..4f9cc9f 100644 --- a/LyricsPy/app.py +++ b/LyricsPy/app.py @@ -55,6 +55,12 @@ def add_album(): return render_template('add_album.html') +@app.route('/album/') +def album(album_id): + album = Album.query.get_or_404(album_id) + songs = Song.query.filter_by(album_id=album_id).all() + return render_template('album.html', album=album, songs=songs) + if __name__ == '__main__': with app.app_context(): db.create_all() diff --git a/LyricsPy/instance/songs.db b/LyricsPy/instance/songs.db index 7c59f1f..1086279 100644 Binary files a/LyricsPy/instance/songs.db and b/LyricsPy/instance/songs.db differ diff --git a/LyricsPy/templates/album.html b/LyricsPy/templates/album.html new file mode 100644 index 0000000..22cfa5b --- /dev/null +++ b/LyricsPy/templates/album.html @@ -0,0 +1,18 @@ +{% extends 'base.html' %} + +{% block content %} +

{{ album.name }}

+

Artist: {{ album.artist }}

+

Year: {{ album.year }}

+ +

Songs in this Album

+ + +Back to Home +{% endblock %} diff --git a/LyricsPy/templates/index.html b/LyricsPy/templates/index.html index 8834a14..1dac9b7 100644 --- a/LyricsPy/templates/index.html +++ b/LyricsPy/templates/index.html @@ -21,7 +21,9 @@

Albums