From d33ee77693cf6fb089c7383ecf6b646469eba0bc Mon Sep 17 00:00:00 2001 From: Kristy Fournier Date: Wed, 21 Jan 2026 15:56:55 -0500 Subject: [PATCH] Moved the creation of the virtual table to the databasegenerator.py --- Server/databaseGenerator.py | 5 ++++- Server/webbyBits.py | 5 ----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Server/databaseGenerator.py b/Server/databaseGenerator.py index 7c879cb..e758efb 100644 --- a/Server/databaseGenerator.py +++ b/Server/databaseGenerator.py @@ -74,7 +74,6 @@ for i in songFiles: # skip any non music files (like directories or cover art) continue try: - print(extension) # get the metadata if(extension.lower() == "mp3"): song = EasyID3(soundLocation+i) @@ -133,4 +132,8 @@ for i in songFiles: # each "song" is stored as a SQLite entry following the format seen below songDatabase.execute(f"INSERT INTO songs (filename, title, artist, art, length, lossless) VALUES (?,?,?,?,?,?)",(i,title,artist,image,length,lossless)) +songDatabase.execute("DROP TABLE IF EXISTS virtualSongs;") +songDatabase.execute("CREATE VIRTUAL TABLE virtualSongs USING fts5(filename, title, artist, art, length, lossless);") +songDatabase.execute("INSERT INTO virtualSongs SELECT * FROM songs;") fileOfDB.commit() +fileOfDB.close() \ No newline at end of file diff --git a/Server/webbyBits.py b/Server/webbyBits.py index 9e38d3b..795ff4e 100644 --- a/Server/webbyBits.py +++ b/Server/webbyBits.py @@ -41,11 +41,6 @@ else: soundLocation += "\\" #Create Virtual table for searching #I'm not sure why i don't do this in the databaseGenerator, but it also takes like 3 seconds so i'm not messing with it rn -songDatabase.execute("DROP TABLE virtualSongs;") -songDatabase.execute("CREATE VIRTUAL TABLE virtualSongs USING fts5(filename, title, artist, art, length, lossless);") -songDatabase.execute("INSERT INTO virtualSongs SELECT * FROM songs;") -fileofDB.commit() -fileofDB.close() #Initializing all the global stuff random.seed()