Not defaulting to new mode

This commit is contained in:
Kristy Fournier 2025-03-10 12:40:38 -04:00
parent 3bb92bfc73
commit 058d1a9a3c
2 changed files with 4 additions and 5 deletions

View file

@ -7,8 +7,7 @@ loading = ["-","\\","|","/"]
parser=argparse.ArgumentParser(description="Options for the generation of the song database") 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('-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/update: Remake database or update current', default= "update")
parser.add_argument('-m', '--mode', help='new mode required temporarily', default= "new")
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('-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/") parser.add_argument('-d','--directory',help="Directory of the song files", default="./sound/")
args = parser.parse_args() args = parser.parse_args()
@ -93,7 +92,7 @@ for i in songFiles:
if len(songFiles) != 1: if len(songFiles) != 1:
index = (songFiles.index(i))%4 index = (songFiles.index(i))%4
print("\r" + str(loading[index] + str(math.floor((songFiles.index(i)/(len(songFiles)-1))*100))+ "%"), end='', flush=True) 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}) songDatabaseList["songData"][i] = ({"title":title,"artist":artist,"art":image,"length":length})
with open('songDatabase.json', 'w') as handle: with open('songDatabase.json', 'w') as handle:

View file

@ -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 - `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* - *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 - 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) - 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* - *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 - 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 - 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 - 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_ - _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 - ~~__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: - `songDatabase.json` stores all the information about each song in this format: