diff --git a/Server/databaseGenerator.py b/Server/databaseGenerator.py index b9e4c2d..6e04639 100644 --- a/Server/databaseGenerator.py +++ b/Server/databaseGenerator.py @@ -7,8 +7,7 @@ loading = ["-","\\","|","/"] parser=argparse.ArgumentParser(description="Options for the generation of the song database") parser.add_argument('-k','--apikey', help='String: LastFM api key', default="") -# parser.add_argument('-m', '--mode', help='new/update: Remake database or update current', default= "update") -parser.add_argument('-m', '--mode', help='new mode required temporarily', default= "new") +parser.add_argument('-m', '--mode', help='new/update: Remake database or update current', default= "update") parser.add_argument('-a', '--art', help="True/False: Add art to the database using LastFm (takes minimum 0.25s per song)", default="True") parser.add_argument('-d','--directory',help="Directory of the song files", default="./sound/") args = parser.parse_args() @@ -93,7 +92,7 @@ for i in songFiles: if len(songFiles) != 1: index = (songFiles.index(i))%4 print("\r" + str(loading[index] + str(math.floor((songFiles.index(i)/(len(songFiles)-1))*100))+ "%"), end='', flush=True) - # each "song" is stored as a dictionary containing the below stuff, and each dictionary is put into a list + # each "song" is stored as a dictionary/JSON entry following the format seen in the readME songDatabaseList["songData"][i] = ({"title":title,"artist":artist,"art":image,"length":length}) with open('songDatabase.json', 'w') as handle: diff --git a/readme.md b/readme.md index 0eb0171..d0de91f 100644 --- a/readme.md +++ b/readme.md @@ -41,13 +41,13 @@ These are specific details on each section of the app, and how to use them - `Filename, Title, Artist, Art, Length` are all saved - *If the title and artist are not in the mp3 metadata, it looks for a format of* `TITLE_ARTIST.mp3` *and otherwise defaults to the file name as the title, and no artist* - Art is retrieved from LastFM - - Running with `--mode (update/new)` either updates the current database and only adds new songs, or recreates the entire database (update is default) + - Running with `--mode (update/new)` either updates the current database and adds new songs/removes deleted songs, or recreates the entire database (update is default, and is faster in art mode) - Running with `--art (True/False)` retrieves art from LastFM or doesn't (True is default) - *Can only generate one song / 0.25 seconds, to avoid pinging the LastFM server too much* - Running with `--apikey (KEYhere)` sets the LastFM key for that run - If this is set to an empty string (Default) the app runs in non-art mode - Running with `--directory (directoryOfmp3s)` allows for sound files to be in a different place - - Default `"./sound"` + - Default `"./sound/"` - _This setting might be kinda iffy on Linux. You're on Linux just go and edit it if you have issues_ - ~~__Make certain you only use forward slashes in your directory, even on Windows__~~ I think this should be fine now i'll check later - `songDatabase.json` stores all the information about each song in this format: