mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 16:22:57 -07:00
API2
This commit is contained in:
parent
9359567a8a
commit
2fcd55eb60
10 changed files with 1671 additions and 156 deletions
|
@ -57,6 +57,7 @@ _INITIALIZED = False
|
|||
started = False
|
||||
|
||||
DATA_DIR = None
|
||||
BACKUP_DIR = None
|
||||
|
||||
CONFIG = None
|
||||
|
||||
|
@ -73,6 +74,7 @@ UMASK = None
|
|||
|
||||
POLLING_FAILOVER = False
|
||||
|
||||
|
||||
def initialize(config_file):
|
||||
with INIT_LOCK:
|
||||
|
||||
|
@ -82,7 +84,6 @@ def initialize(config_file):
|
|||
global LATEST_VERSION
|
||||
global UMASK
|
||||
global POLLING_FAILOVER
|
||||
|
||||
CONFIG = plexpy.config.Config(config_file)
|
||||
|
||||
assert CONFIG is not None
|
||||
|
@ -126,6 +127,12 @@ def initialize(config_file):
|
|||
except OSError as e:
|
||||
logger.error("Could not create cache dir '%s': %s", DATA_DIR, e)
|
||||
|
||||
plexpy.BACKUP_DIR = os.path.join(plexpy.PROG_DIR, 'backups')
|
||||
try:
|
||||
os.makedirs(plexpy.BACKUP_DIR)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
# Initialize the database
|
||||
logger.info('Checking to see if the database has all tables....')
|
||||
try:
|
||||
|
@ -186,7 +193,6 @@ def initialize(config_file):
|
|||
_INITIALIZED = True
|
||||
return True
|
||||
|
||||
|
||||
def daemonize():
|
||||
if threading.activeCount() != 1:
|
||||
logger.warn(
|
||||
|
@ -801,6 +807,7 @@ def dbcheck():
|
|||
conn_db.commit()
|
||||
c_db.close()
|
||||
|
||||
|
||||
def shutdown(restart=False, update=False):
|
||||
cherrypy.engine.exit()
|
||||
SCHED.shutdown(wait=False)
|
||||
|
@ -833,6 +840,7 @@ def shutdown(restart=False, update=False):
|
|||
|
||||
os._exit(0)
|
||||
|
||||
|
||||
def generate_uuid():
|
||||
logger.debug(u"Generating UUID...")
|
||||
return uuid.uuid4().hex
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue