summaryrefslogtreecommitdiff
path: root/scrap/database.py
diff options
context:
space:
mode:
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