Skip to content

Commit

Permalink
Fixed other issues with peewee
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed May 27, 2021
1 parent d34add9 commit 75c003a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions bazarr/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ class Meta:
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):
Expand Down
6 changes: 3 additions & 3 deletions bazarr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 75c003a

Please sign in to comment.