Moved the creation of the virtual table to the databasegenerator.py
This commit is contained in:
parent
758f399636
commit
d33ee77693
2 changed files with 4 additions and 6 deletions
|
|
@ -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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue