trying to fix deleteymode, work in progress
This commit is contained in:
parent
018fc7579d
commit
49c1b0bf25
1 changed files with 6 additions and 2 deletions
|
|
@ -30,11 +30,15 @@ if args.mode == "update":
|
|||
songDatabaseList={"songDirectory":soundLocation,'songData':{}}
|
||||
|
||||
for i in songDatabaseList["songData"]:
|
||||
deleteySongs = []
|
||||
try:
|
||||
songFiles.index(i) != -1
|
||||
except:
|
||||
print("deleted: " + i + " from database")
|
||||
songDatabaseList.remove(i)
|
||||
deleteySongs.append(i)
|
||||
if deleteySongs:
|
||||
print("deleted: " + ", ".join(deleteySongs)+ " from database")
|
||||
for i in deleteySongs:
|
||||
songDatabaseList["songData"].pop(i)
|
||||
for i in songDatabaseList["songData"]:
|
||||
songFiles.remove(i)
|
||||
print("new songs: " + str(songFiles))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue