Add checks for no database, print error
This commit is contained in:
parent
d4a0702a8a
commit
bec0e301b2
1 changed files with 5 additions and 2 deletions
|
|
@ -42,8 +42,11 @@ fileofDB = sql.connect("songDatabase.db")
|
||||||
songDatabase = fileofDB.cursor()
|
songDatabase = fileofDB.cursor()
|
||||||
|
|
||||||
#song directory
|
#song directory
|
||||||
songDatabase.execute("SELECT * FROM meta WHERE id='songDirectory';")
|
try:
|
||||||
soundLocation = songDatabase.fetchall()[0][1]
|
songDatabase.execute("SELECT * FROM meta WHERE id='songDirectory';")
|
||||||
|
soundLocation = songDatabase.fetchall()[0][1]
|
||||||
|
except sql.OperationalError:
|
||||||
|
print("No Database Found, try running databaseGenerator.py")
|
||||||
if soundLocation[-1] == "/" or soundLocation[-1] == "\\":
|
if soundLocation[-1] == "/" or soundLocation[-1] == "\\":
|
||||||
pass
|
pass
|
||||||
elif "/" in soundLocation:
|
elif "/" in soundLocation:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue