Add export directory

This commit is contained in:
JonnyWong16 2020-08-03 14:23:31 -07:00
parent b872cce2a4
commit 6334ffa197
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
7 changed files with 28 additions and 3 deletions

1
.gitignore vendored
View file

@ -17,6 +17,7 @@ version.lock
logs/*
backups/*
cache/*
exports/*
newsletters/*
*.mmdb
version.txt

View file

@ -49,6 +49,10 @@ DOCUMENTATION :: END
<td>Cache Directory:</td>
<td>${plexpy.CONFIG.CACHE_DIR}</td>
</tr>
<tr>
<td>Export Directory:</td>
<td>${plexpy.CONFIG.EXPORT_DIR}</td>
</tr>
<tr>
<td>Newsletter Directory:</td>
<td>${plexpy.CONFIG.NEWSLETTER_DIR}</td>

View file

@ -1442,6 +1442,22 @@
</div>
</div>
</div>
<div class="form-group">
<label for="export_dir">Export Directory</label> ${docker_msg | n}
<div class="row">
<div class="col-md-7">
<div class="input-group">
<input type="text" class="form-control directory-settings" id="export_dir" name="export_dir" value="${config['export_dir']}" ${docker_setting}>
<span class="input-group-btn">
<button class="btn btn-form" type="button" id="export_dir_browse" data-toggle="browse" data-filter=".folderonly" data-target="#export_dir" ${docker_setting}>Browse</button>
</span>
</div>
<div class="btn-group">
<button class="btn btn-form" type="button" id="clear_exports">Clear All Exports</button>
</div>
</div>
</div>
</div>
<p><input type="button" class="btn btn-bright save-button" value="Save" data-success="Changes saved successfully"></p>

View file

@ -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')

View file

@ -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'

View file

@ -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,

View file

@ -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),