|
|
@ -6,10 +6,12 @@ import logging
|
|
|
|
|
|
|
|
|
|
|
|
from flask_restx import Resource, Namespace
|
|
|
|
from flask_restx import Resource, Namespace
|
|
|
|
from tzlocal import get_localzone_name
|
|
|
|
from tzlocal import get_localzone_name
|
|
|
|
|
|
|
|
from alembic.migration import MigrationContext
|
|
|
|
|
|
|
|
|
|
|
|
from radarr.info import get_radarr_info
|
|
|
|
from radarr.info import get_radarr_info
|
|
|
|
from sonarr.info import get_sonarr_info
|
|
|
|
from sonarr.info import get_sonarr_info
|
|
|
|
from app.get_args import args
|
|
|
|
from app.get_args import args
|
|
|
|
|
|
|
|
from app.database import engine, database, select
|
|
|
|
from init import startTime
|
|
|
|
from init import startTime
|
|
|
|
|
|
|
|
|
|
|
|
from ..utils import authenticate
|
|
|
|
from ..utils import authenticate
|
|
|
@ -34,6 +36,16 @@ class SystemStatus(Resource):
|
|
|
|
timezone = "Exception while getting time zone name."
|
|
|
|
timezone = "Exception while getting time zone name."
|
|
|
|
logging.exception("BAZARR is unable to get configured time zone name.")
|
|
|
|
logging.exception("BAZARR is unable to get configured time zone name.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
database_version = ".".join([str(x) for x in engine.dialect.server_version_info])
|
|
|
|
|
|
|
|
except Exception:
|
|
|
|
|
|
|
|
database_version = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
database_migration = MigrationContext.configure(engine.connect()).get_current_revision()
|
|
|
|
|
|
|
|
except Exception:
|
|
|
|
|
|
|
|
database_migration = "unknown"
|
|
|
|
|
|
|
|
|
|
|
|
system_status = {}
|
|
|
|
system_status = {}
|
|
|
|
system_status.update({'bazarr_version': os.environ["BAZARR_VERSION"]})
|
|
|
|
system_status.update({'bazarr_version': os.environ["BAZARR_VERSION"]})
|
|
|
|
system_status.update({'package_version': package_version})
|
|
|
|
system_status.update({'package_version': package_version})
|
|
|
@ -41,6 +53,8 @@ class SystemStatus(Resource):
|
|
|
|
system_status.update({'radarr_version': get_radarr_info.version()})
|
|
|
|
system_status.update({'radarr_version': get_radarr_info.version()})
|
|
|
|
system_status.update({'operating_system': platform.platform()})
|
|
|
|
system_status.update({'operating_system': platform.platform()})
|
|
|
|
system_status.update({'python_version': platform.python_version()})
|
|
|
|
system_status.update({'python_version': platform.python_version()})
|
|
|
|
|
|
|
|
system_status.update({'database_engine': f'{engine.dialect.name.capitalize()} {database_version}'})
|
|
|
|
|
|
|
|
system_status.update({'database_migration': database_migration})
|
|
|
|
system_status.update({'bazarr_directory': os.path.dirname(os.path.dirname(os.path.dirname(
|
|
|
|
system_status.update({'bazarr_directory': os.path.dirname(os.path.dirname(os.path.dirname(
|
|
|
|
os.path.dirname(__file__))))})
|
|
|
|
os.path.dirname(__file__))))})
|
|
|
|
system_status.update({'bazarr_config_directory': args.config_dir})
|
|
|
|
system_status.update({'bazarr_config_directory': args.config_dir})
|
|
|
|