diff --git a/LyricsPy/servicios/instance/songs.db b/LyricsPy/servicios/instance/songs.db index 6262314..3d4b165 100644 Binary files a/LyricsPy/servicios/instance/songs.db and b/LyricsPy/servicios/instance/songs.db differ diff --git a/LyricsPy/servicios/lyrics/models.py b/LyricsPy/servicios/lyrics/models.py index edc40ae..0d91888 100644 --- a/LyricsPy/servicios/lyrics/models.py +++ b/LyricsPy/servicios/lyrics/models.py @@ -18,6 +18,8 @@ class Song(db.Model): author = db.Column(db.String(100), nullable=False) album_id = db.Column(db.Integer, db.ForeignKey('album.id'), nullable=False) lyrics = db.Column(db.Text, nullable=False) + pista = db.Column(db.Integer, nullable=False) # Nuevo campo + def __repr__(self): return f'' diff --git a/LyricsPy/servicios/lyrics/paginas.py b/LyricsPy/servicios/lyrics/paginas.py index 397c336..d87a14f 100644 --- a/LyricsPy/servicios/lyrics/paginas.py +++ b/LyricsPy/servicios/lyrics/paginas.py @@ -21,6 +21,8 @@ def add_song(): author = request.form['author'] album_id = request.form['album_id'] lyrics = request.form['lyrics'] + pista = request.form['pista'] + new_song = Song(title=title, author=author, album_id=album_id, lyrics=lyrics) db.session.add(new_song) diff --git a/LyricsPy/servicios/lyrics/templates/add_song.html b/LyricsPy/servicios/lyrics/templates/add_song.html index 9e1b07d..8b2e2e5 100644 --- a/LyricsPy/servicios/lyrics/templates/add_song.html +++ b/LyricsPy/servicios/lyrics/templates/add_song.html @@ -3,6 +3,9 @@ {% block content %}

Añadir nueva canción

+ + + diff --git a/LyricsPy/servicios/lyrics/templates/album.html b/LyricsPy/servicios/lyrics/templates/album.html index c49d353..46be96d 100644 --- a/LyricsPy/servicios/lyrics/templates/album.html +++ b/LyricsPy/servicios/lyrics/templates/album.html @@ -19,14 +19,16 @@ - - - + + + + {% for song in songs %} + diff --git a/LyricsPy/servicios/lyrics/templates/index.html b/LyricsPy/servicios/lyrics/templates/index.html index f75a40c..3a8d43f 100644 --- a/LyricsPy/servicios/lyrics/templates/index.html +++ b/LyricsPy/servicios/lyrics/templates/index.html @@ -12,6 +12,7 @@
TitleAuthorAlbumPistaTítuloAutorÁlbum
{{ song.pista }} {{ song.title }} {{ song.author }} {{ song.album.name }}
+ @@ -20,6 +21,7 @@ {% for song in songs %} + diff --git a/LyricsPy/servicios/lyrics/templates/search.html b/LyricsPy/servicios/lyrics/templates/search.html index 028f03a..abb67c4 100644 --- a/LyricsPy/servicios/lyrics/templates/search.html +++ b/LyricsPy/servicios/lyrics/templates/search.html @@ -7,6 +7,7 @@
Pista Título Autor Álbum
{{ song.pista }} {{ song.title }} {{ song.author }} {{ song.album.name }}
+ @@ -15,6 +16,7 @@ {% for song in songs %} +
Pista Título Autor Álbum
{{ song.pista }} {{ song.title }} {{ song.author }} {{ song.album.name }}