1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-26 09:37:25 +00:00

Continuing development.

This commit is contained in:
Louis Vézina 2019-08-21 13:57:43 -04:00
parent df622a2259
commit 5d642ce2e6
2 changed files with 8 additions and 9 deletions

View file

@ -1,10 +1,8 @@
import os
import atexit
from get_args import args
from peewee import *
from playhouse.sqliteq import SqliteQueueDatabase
from playhouse.reflection import generate_models
from helper import path_replace, path_replace_movie, path_replace_reverse, path_replace_reverse_movie
@ -168,11 +166,6 @@ class TableSettingsNotifier(BaseModel):
table_name = 'table_settings_notifier'
@atexit.register
def _stop_worker_threads():
database.stop()
def database_init():
database.start()
database.connect()
@ -190,3 +183,8 @@ def database_init():
System.configured: 0
}
).execute()
def database_close():
if not database.is_closed():
database.close()

View file

@ -22,8 +22,8 @@ import operator
from get_args import args
from init import *
from database import database_init, TableEpisodes, TableShows, TableMovies, TableHistory, TableHistoryMovie, \
TableSettingsLanguages, TableSettingsNotifier, System
from database import database_init, database_close, TableEpisodes, TableShows, TableMovies, TableHistory, \
TableHistoryMovie, TableSettingsLanguages, TableSettingsNotifier, System
# Initiate database
database_init()
@ -187,6 +187,7 @@ def shutdown():
else:
stop_file.write('')
stop_file.close()
database_close()
server.stop()