Skip to content

Commit

Permalink
improve database functions
Browse files Browse the repository at this point in the history
  • Loading branch information
aaanh committed Jan 15, 2024
1 parent 2c3e61e commit 845a9be
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions database/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
def main():
args = sys.argv[1:]

if len(args) == 0: # default no args
dd.init_sql()
dd.update_db(dd.fetch_new_data())
con = sqlite3.connect("sv_db.db")
cur = con.cursor()
dd.update_db(dd.fetch_new_data())
sql_data = cur.execute('SELECT * FROM servants').fetchall()
dd.download_sv_faces()
con.close()


con = sqlite3.connect("sv_db.db")
cur = con.cursor()

Expand All @@ -26,10 +37,6 @@ def main():
if len(args) == 1 and args[0] == "zip":
dd.zip_sv_faces()

if os.stat("./sv_db.db").st_size == 0:
dd.init_sql()
dd.update_db(dd.load_json())


if __name__ == "__main__":
main()

0 comments on commit 845a9be

Please sign in to comment.