diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 0d887b4a..a824d543 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -82,15 +82,15 @@ available_notification_agents = sorted(notifiers.available_notification_agents() Backup Directory: - ${plexpy.CONFIG.BACKUP_DIR} + ${config['backup_dir']} Cache Directory: - ${plexpy.CONFIG.CACHE_DIR} + ${config['cache_dir']} Log Directory: - ${plexpy.CONFIG.LOG_DIR} + ${config['log_dir']} % if plexpy.ARGS: @@ -169,6 +169,35 @@ available_notification_agents = sorted(notifiers.available_notification_agents()

Group successive play history by the same user as a single entry in the tables and watch statistics.

+ +
+

Directories

+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+

@@ -1856,10 +1885,11 @@ $(document).ready(function() { authChanged = false; httpChanged = false; monitorChanged = false; + directoryChanged = false; // Alert the user that their changes require a restart. function postSaveChecks() { - if ((serverChanged && $('#monitoring_use_websocket').is(":checked")) || authChanged || httpChanged || monitorChanged) { + if ((serverChanged && $('#monitoring_use_websocket').is(":checked")) || authChanged || httpChanged || monitorChanged || directoryChanged) { $('#restart-modal').modal('show'); } } @@ -1972,6 +2002,10 @@ $(document).ready(function() { monitorChanged = true; }); + $( ".directory-settings" ).change(function() { + directoryChanged = true; + }); + $( ".pms-settings" ).change(function() { serverChanged = true; $("#pms_identifier").val(""); diff --git a/plexpy/__init__.py b/plexpy/__init__.py index 2f544920..5cfce3b6 100644 --- a/plexpy/__init__.py +++ b/plexpy/__init__.py @@ -103,7 +103,7 @@ def initialize(config_file): if not CONFIG.HTTPS_KEY: CONFIG.HTTPS_KEY = os.path.join(DATA_DIR, 'server.key') - if not CONFIG.LOG_DIR.startswith(os.path.abspath(DATA_DIR)): + if not CONFIG.LOG_DIR: CONFIG.LOG_DIR = os.path.join(DATA_DIR, 'logs') if not os.path.exists(CONFIG.LOG_DIR): @@ -120,8 +120,7 @@ def initialize(config_file): logger.initLogger(console=not QUIET, log_dir=CONFIG.LOG_DIR, verbose=VERBOSE) - if not CONFIG.BACKUP_DIR.startswith(os.path.abspath(DATA_DIR)): - # Put the backup dir in the data dir for now + if not CONFIG.BACKUP_DIR: CONFIG.BACKUP_DIR = os.path.join(DATA_DIR, 'backups') if not os.path.exists(CONFIG.BACKUP_DIR): try: @@ -129,14 +128,13 @@ def initialize(config_file): except OSError as e: logger.error("Could not create backup dir '%s': %s", BACKUP_DIR, e) - if not CONFIG.CACHE_DIR.startswith(os.path.abspath(DATA_DIR)): - # Put the cache dir in the data dir for now + if not CONFIG.CACHE_DIR: CONFIG.CACHE_DIR = os.path.join(DATA_DIR, 'cache') if not os.path.exists(CONFIG.CACHE_DIR): try: os.makedirs(CONFIG.CACHE_DIR) except OSError as e: - logger.error("Could not create cache dir '%s': %s", DATA_DIR, e) + logger.error("Could not create cache dir '%s': %s", CACHE_DIR, e) # Initialize the database logger.info('Checking to see if the database has all tables....') diff --git a/plexpy/webserve.py b/plexpy/webserve.py index e2afdcf1..9da17b9d 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -1165,8 +1165,9 @@ class WebInterface(object): "api_key": plexpy.CONFIG.API_KEY, "update_db_interval": plexpy.CONFIG.UPDATE_DB_INTERVAL, "freeze_db": checked(plexpy.CONFIG.FREEZE_DB), - "log_dir": plexpy.CONFIG.LOG_DIR, + "backup_dir": plexpy.CONFIG.BACKUP_DIR, "cache_dir": plexpy.CONFIG.CACHE_DIR, + "log_dir": plexpy.CONFIG.LOG_DIR, "check_github": checked(plexpy.CONFIG.CHECK_GITHUB), "interface_list": interface_list, "cache_sizemb": plexpy.CONFIG.CACHE_SIZEMB,