diff options
author | morpheus65535 <[email protected]> | 2021-05-27 08:07:16 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2021-05-27 08:07:16 -0400 |
commit | 75c003ab674aadf5e9e451ecaa24a1b3cad1e8f3 (patch) | |
tree | a2bcd7227a6bdc4d80f882821f099ee0af343468 | |
parent | d34add9fa4a7e9e894953ca55222643e76d433bd (diff) | |
download | bazarr-75c003ab674aadf5e9e451ecaa24a1b3cad1e8f3.tar.gz bazarr-75c003ab674aadf5e9e451ecaa24a1b3cad1e8f3.zip |
Fixed other issues with peewee
-rw-r--r-- | bazarr/database.py | 3 | ||||
-rw-r--r-- | bazarr/main.py | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/bazarr/database.py b/bazarr/database.py index edeadb285..44fa35ac1 100644 --- a/bazarr/database.py +++ b/bazarr/database.py @@ -246,6 +246,9 @@ database.create_tables([System, TableShows, TableShowsRootfolder]) +# add the system table single row if it's not existing +if not System.select().count(): + System.insert({System.configured: '0', System.updated: '0'}).execute() class SqliteDictPathMapper: def __init__(self): diff --git a/bazarr/main.py b/bazarr/main.py index 0f029b326..7e49be42d 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -100,14 +100,14 @@ def catch_all(path): auth = False try: - updated = System.select().where(updated='1') + updated = System.get().updated except: - updated = False + updated = '0' inject = dict() inject["baseUrl"] = base_url inject["canUpdate"] = not args.no_update - inject["hasUpdate"] = len(updated) + inject["hasUpdate"] = updated != '0' if auth: inject["apiKey"] = settings.auth.apikey |