diff options
author | nil <nil@tfwhyno.gf> | 2024-10-02 17:48:56 +0200 |
---|---|---|
committer | nil <nil@tfwhyno.gf> | 2024-10-02 17:48:56 +0200 |
commit | 0972fa6eab8c9111311f082ba8abfdc6b4a40945 (patch) | |
tree | 4eedbdc1a7cfdeee9d651c9871a9f26ab6da56d4 /rust/scripts/populate/main.py | |
parent | 012c2c03b29a987ca4eead023ded22e01aa7477b (diff) |
commit changes
Diffstat (limited to 'rust/scripts/populate/main.py')
-rw-r--r-- | rust/scripts/populate/main.py | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/rust/scripts/populate/main.py b/rust/scripts/populate/main.py deleted file mode 100644 index ec0157c..0000000 --- a/rust/scripts/populate/main.py +++ /dev/null @@ -1,46 +0,0 @@ -from albums import album_data -import api -import parser -import database - - -def start(): - print("downloading data...") - api.download_albums(album_data) - - print("uploading data...") - upload_albums( - get_album_data(), - get_artist_names() - ) - database.close() - print("upload finished!") - print("remember to move the covers directory once you're done") - - -def upload_albums(album_data, artist_names): - database.process_artists(artist_names) - database.process_albums(album_data) - - -def get_album_data(): - result = [] - - for artist_id, artist in enumerate(album_data, 1): - album_list = artist[1] - - for album_id, album in enumerate(album_list, 1): - result.append(parser.process_json_file(album, album_id, artist_id)) - - return result - - -def get_artist_names(): - artist_data = [] - [artist_data.append( - artist[0] - ) for artist in album_data] - return artist_data - - -start() |