summaryrefslogtreecommitdiff
path: root/scrap/database.py
diff options
context:
space:
mode:
authornil0j <nil.jimeno@estudiant.fjaverianas.com>2024-09-26 17:13:42 +0200
committernil0j <nil.jimeno@estudiant.fjaverianas.com>2024-09-26 17:13:42 +0200
commit950bb3533cf59e074f485dfbb48fcf931e245ea6 (patch)
tree23be01e7584d7227451c2c710f1fe1add4dfa499 /scrap/database.py
parentabad2ebad9c78e3978343aa0fc572a87dbf9fa78 (diff)
update scrap
Diffstat (limited to 'scrap/database.py')
-rw-r--r--scrap/database.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scrap/database.py b/scrap/database.py
index 3934361..dab2592 100644
--- a/scrap/database.py
+++ b/scrap/database.py
@@ -56,15 +56,16 @@ def setup():
def process_albums(album_list):
[process_album(album, album_id)
- for album_id, album in enumerate(album_list)]
+ for album_id, album in enumerate(album_list, 1)]
def process_album(album, album_id):
upload_album(album)
- [upload_song(song, album_id+1) for song in album.songs]
+ [upload_song(song, album_id) for song in album.songs]
def upload_album(album):
+ album.name = album.name.lower()
cursor.execute("""
INSERT INTO album (
name, cover, artist_id
@@ -99,6 +100,7 @@ def process_artists(artist_names):
def process_artist(artist):
+ artist = artist.lower()
cursor.execute("""
INSERT INTO artist (
name