diff --git a/.gitignore b/.gitignore index 6bb5c9b5..e55fd0af 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ version.lock logs/* backups/* cache/* +exports/* newsletters/* *.mmdb version.txt diff --git a/data/interfaces/default/configuration_table.html b/data/interfaces/default/configuration_table.html index 989b1766..1fed45bd 100644 --- a/data/interfaces/default/configuration_table.html +++ b/data/interfaces/default/configuration_table.html @@ -49,6 +49,10 @@ DOCUMENTATION :: END Cache Directory: ${plexpy.CONFIG.CACHE_DIR} + + Export Directory: + ${plexpy.CONFIG.EXPORT_DIR} + Newsletter Directory: ${plexpy.CONFIG.NEWSLETTER_DIR} diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index d857479a..5dfa5169 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1442,6 +1442,22 @@ +
+ ${docker_msg | n} +
+
+
+ + + + +
+
+ +
+
+
+

diff --git a/plexpy/__init__.py b/plexpy/__init__.py index 0d45a017..643920f5 100644 --- a/plexpy/__init__.py +++ b/plexpy/__init__.py @@ -1,4 +1,4 @@ -# This file is part of Tautulli. +# This file is part of Tautulli. # # Tautulli is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -226,6 +226,8 @@ def initialize(config_file): CONFIG.BACKUP_DIR, os.path.join(DATA_DIR, 'backups'), 'backups') CONFIG.CACHE_DIR, _ = check_folder_writable( CONFIG.CACHE_DIR, os.path.join(DATA_DIR, 'cache'), 'cache') + CONFIG.EXPORT_DIR, _ = check_folder_writable( + CONFIG.EXPORT_DIR, os.path.join(DATA_DIR, 'exports'), 'exports') CONFIG.NEWSLETTER_DIR, _ = check_folder_writable( CONFIG.NEWSLETTER_DIR, os.path.join(DATA_DIR, 'newsletters'), 'newsletters') diff --git a/plexpy/config.py b/plexpy/config.py index 8c4fab8d..30bfe119 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -96,6 +96,7 @@ _CONFIG_DEFINITIONS = { 'CONFIG_VERSION': (int, 'Advanced', 0), 'DO_NOT_OVERRIDE_GIT_BRANCH': (int, 'General', 0), 'ENABLE_HTTPS': (int, 'General', 0), + 'EXPORT_DIR': (str, 'General', ''), 'FIRST_RUN_COMPLETE': (int, 'General', 0), 'FREEZE_DB': (int, 'General', 0), 'GET_FILE_SIZES': (int, 'General', 0), @@ -194,7 +195,7 @@ _WHITELIST_KEYS = ['HTTPS_KEY'] _DO_NOT_IMPORT_KEYS = [ 'FIRST_RUN_COMPLETE', 'GET_FILE_SIZES_HOLD', 'GIT_PATH', 'PMS_LOGS_FOLDER', - 'BACKUP_DIR', 'CACHE_DIR', 'LOG_DIR', 'NEWSLETTER_DIR', 'NEWSLETTER_CUSTOM_DIR', + 'BACKUP_DIR', 'CACHE_DIR', 'EXPORT_DIR', 'LOG_DIR', 'NEWSLETTER_DIR', 'NEWSLETTER_CUSTOM_DIR', 'HTTP_HOST', 'HTTP_PORT', 'HTTP_ROOT', 'HTTP_USERNAME', 'HTTP_PASSWORD', 'HTTP_HASH_PASSWORD', 'HTTP_HASHED_PASSWORD', 'ENABLE_HTTPS', 'HTTPS_CREATE_CERT', 'HTTPS_CERT', 'HTTPS_CERT_CHAIN', 'HTTPS_KEY' diff --git a/plexpy/exporter.py b/plexpy/exporter.py index 116c43fd..fb390cb9 100644 --- a/plexpy/exporter.py +++ b/plexpy/exporter.py @@ -897,7 +897,7 @@ def export(section_id=None, rating_key=None, file_format='json'): return filename = helpers.clean_filename(filename) - filepath = os.path.join(plexpy.CONFIG.CACHE_DIR, filename) + filepath = os.path.join(plexpy.CONFIG.EXPORT_DIR, filename) logger.info("Tautulli Exporter :: Starting export for '%s'...", filename) export_id = set_export_state(timestamp=timestamp, diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 2076e184..407aae97 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -3052,6 +3052,7 @@ class WebInterface(object): "backup_dir": plexpy.CONFIG.BACKUP_DIR, "backup_interval": plexpy.CONFIG.BACKUP_INTERVAL, "cache_dir": plexpy.CONFIG.CACHE_DIR, + "export_dir": plexpy.CONFIG.EXPORT_DIR, "log_dir": plexpy.CONFIG.LOG_DIR, "log_blacklist": checked(plexpy.CONFIG.LOG_BLACKLIST), "check_github": checked(plexpy.CONFIG.CHECK_GITHUB),