Merge pull request #1043 from JackDandy/feature/AddDiskFreeOptional

Add option "Display disk free" to general config/interface page (defa…
This commit is contained in:
JackDandy 2018-01-25 20:43:18 +00:00 committed by GitHub
commit ce79d91430
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 4 deletions

View file

@ -2,13 +2,14 @@
* Change improve core scheduler logic
* Change improve media process to parse anime format 'Show Name 123 - 001 - Ep 1 name'
* Add free space stat (if obtainable) of parent folder(s) to footer
* Add option "Display disk free" to general config/interface page (default enabled)
[develop changelog]
* Fix Events shutdown (a manual start-up is required after updating to this fix)
* Add free space stat (if obtainable) of parent folder(s) to footer
* Add 'PB', 'EB', 'ZB', 'YB' to recognised output sizes
* Add 'PB', 'EB', 'ZB', 'YB' to output size formats
### 0.13.14 (2018-01-25 16:20:00 UTC)

View file

@ -335,6 +335,17 @@
</label>
</div>
#if not hasattr($sickbeard, 'DISPLAY_FREESPACE')#<span class="red-text">Restart SickGear to reveal new option here</span>#else#
<div class="field-pair">
<label for="display-freespace">
<span class="component-title">Display freespace</span>
<span class="component-desc">
<input type="checkbox" name="display_freespace" id="display-freespace"#echo ('', $checked)[$sg_var('DISPLAY_FREESPACE', True)]#>
<p>free space of parent locations is refreshed into any page footer request</p>
</span>
</label>
</div>
#end if
<div class="field-pair">
<label for="sort_article">
<span class="component-title">Sort with "The", "A", "An"</span>

View file

@ -153,6 +153,7 @@ ROOT_DIRS = None
TRASH_REMOVE_SHOW = False
TRASH_ROTATE_LOGS = False
HOME_SEARCH_FOCUS = True
DISPLAY_FREESPACE = True
SORT_ARTICLE = False
DEBUG = False
SHOW_TAGS = []
@ -585,7 +586,7 @@ def initialize(console_logging=True):
VERSION_NOTIFY, AUTO_UPDATE, UPDATE_FREQUENCY, NOTIFY_ON_UPDATE
# Gen Config/Interface
global THEME_NAME, DEFAULT_HOME, FANART_LIMIT, SHOWLIST_TAGVIEW, SHOW_TAGS, \
HOME_SEARCH_FOCUS, USE_IMDB_INFO, IMDB_ACCOUNTS, SORT_ARTICLE, FUZZY_DATING, TRIM_ZERO, \
HOME_SEARCH_FOCUS, USE_IMDB_INFO, IMDB_ACCOUNTS, DISPLAY_FREESPACE, SORT_ARTICLE, FUZZY_DATING, TRIM_ZERO, \
DATE_PRESET, TIME_PRESET, TIME_PRESET_W_SECONDS, TIMEZONE_DISPLAY, \
WEB_USERNAME, WEB_PASSWORD, CALENDAR_UNPROTECTED, USE_API, API_KEY, WEB_PORT, WEB_LOG, \
ENABLE_HTTPS, HTTPS_CERT, HTTPS_KEY, WEB_IPV6, WEB_IPV64, HANDLE_REVERSE_PROXY, SEND_SECURITY_HEADERS
@ -727,6 +728,7 @@ def initialize(console_logging=True):
USE_IMDB_INFO = bool(check_setting_int(CFG, 'GUI', 'use_imdb_info', 1))
IMDB_ACCOUNTS = CFG.get('GUI', []).get('imdb_accounts', [IMDB_DEFAULT_LIST_ID, IMDB_DEFAULT_LIST_NAME])
HOME_SEARCH_FOCUS = bool(check_setting_int(CFG, 'General', 'home_search_focus', HOME_SEARCH_FOCUS))
DISPLAY_FREESPACE = bool(check_setting_int(CFG, 'General', 'display_freespace', 1))
SORT_ARTICLE = bool(check_setting_int(CFG, 'General', 'sort_article', 0))
FUZZY_DATING = bool(check_setting_int(CFG, 'GUI', 'fuzzy_dating', 0))
TRIM_ZERO = bool(check_setting_int(CFG, 'GUI', 'trim_zero', 0))
@ -1613,6 +1615,7 @@ def save_config():
new_config['General']['trash_remove_show'] = int(TRASH_REMOVE_SHOW)
new_config['General']['trash_rotate_logs'] = int(TRASH_ROTATE_LOGS)
new_config['General']['home_search_focus'] = int(HOME_SEARCH_FOCUS)
new_config['General']['display_freespace'] = int(DISPLAY_FREESPACE)
new_config['General']['sort_article'] = int(SORT_ARTICLE)
new_config['General']['proxy_setting'] = PROXY_SETTING
new_config['General']['proxy_indexers'] = int(PROXY_INDEXERS)

View file

@ -1567,7 +1567,7 @@ def df():
"""
result = []
min_output = True
if sickbeard.ROOT_DIRS:
if sickbeard.ROOT_DIRS and sickbeard.DISPLAY_FREESPACE:
targets = []
for path in sickbeard.ROOT_DIRS.split('|')[1:]:
location_parts = os.path.splitdrive(path)