Add config to change media process log message if there is no media to process.

This commit is contained in:
JackDandy 2023-04-16 01:31:51 +01:00
parent 1579df04f1
commit 8223edb2cf
5 changed files with 24 additions and 7 deletions

View file

@ -12,6 +12,7 @@
* Update urllib3 1.26.14 (a06c05c) to 1.26.15 (25cca389)
* Change add jobs to centralise scheduler activities
* Change refactor scene_exceptions
* Add config to change media process log message if there is no media to process
### 3.28.0 (2023-04-12 13:05:00 UTC)

View file

@ -85,7 +85,7 @@
<span class="component-desc">
<input type="checkbox" name="process_automatically" id="process_automatically" #if $sickgear.PROCESS_AUTOMATICALLY == True then $checked else ''#>
<p>files in the <em>completed TV downloads</em> folder</p>
<p class="clear-left note"><b>note:</b> do not enable with external post processing scripts like sabTosickgear for SABnzbd, or NZBMedia for NZBGET</p>
<p class="clear-left note"><b>note:</b> do not enable with external post processing scripts like sabTosickgear for SABnzbd, or NZBMedia for NZBGET unless you're an expert</p>
</span>
</label>
</div>
@ -109,6 +109,17 @@
</span>
</label>
</div>
<div class="field-pair">
<label for="process_positive_log">
<span class="component-title">If no media to process</span>
<span class="component-desc">
<input type="checkbox" name="process_positive_log" id="process_positive_log" #if $sickgear.PROCESS_POSITIVE_LOG then $checked else ''#>
<p>use positive log message "<i class="grey-text">Success, no media to process.</i>"</p>
<p class="clear-left note">some setups require the old warning "<i class="grey-text">Failed! Did not process any files.</i>"</p>
</span>
</label>
</div>
#if False:
"""
<div class="field-pair">

View file

@ -295,6 +295,7 @@ PROCESS_LAST_CLEANUP = False
PROCESS_METHOD = None
MOVE_ASSOCIATED_FILES = False
POSTPONE_IF_SYNC_FILES = True
PROCESS_POSITIVE_LOG = True
NFO_RENAME = True
TV_DOWNLOAD_DIR = None
UNPACK = False
@ -716,7 +717,7 @@ def init_stage_1(console_logging):
SUBTITLES_HISTORY, SUBTITLES_SERVICES_LIST, SUBTITLES_SERVICES_ENABLED, SUBTITLES_SERVICES_AUTH
# Media Process/Post-Processing
global TV_DOWNLOAD_DIR, PROCESS_METHOD, PROCESS_AUTOMATICALLY, MEDIAPROCESS_INTERVAL, \
POSTPONE_IF_SYNC_FILES, EXTRA_SCRIPTS, SG_EXTRA_SCRIPTS, \
POSTPONE_IF_SYNC_FILES, PROCESS_POSITIVE_LOG, EXTRA_SCRIPTS, SG_EXTRA_SCRIPTS, \
DEFAULT_MEDIAPROCESS_INTERVAL, MIN_MEDIAPROCESS_INTERVAL, \
UNPACK, SKIP_REMOVED_FILES, MOVE_ASSOCIATED_FILES, NFO_RENAME, RENAME_EPISODES, AIRDATE_EPISODES, \
USE_FAILED_DOWNLOADS, DELETE_FAILED
@ -1022,6 +1023,7 @@ def init_stage_1(console_logging):
PROCESS_LAST_CLEANUP = bool(check_setting_int(CFG, 'General', 'process_last_cleanup', 0))
MOVE_ASSOCIATED_FILES = bool(check_setting_int(CFG, 'General', 'move_associated_files', 0))
POSTPONE_IF_SYNC_FILES = bool(check_setting_int(CFG, 'General', 'postpone_if_sync_files', 1))
PROCESS_POSITIVE_LOG = bool(check_setting_int(CFG, 'General', 'process_positive_log', 0))
NFO_RENAME = bool(check_setting_int(CFG, 'General', 'nfo_rename', 1))
CREATE_MISSING_SHOW_DIRS = bool(check_setting_int(CFG, 'General', 'create_missing_show_dirs', 0))
SHOW_DIRS_WITH_DOTS = bool(check_setting_int(CFG, 'General', 'show_dirs_with_dots', 0))
@ -1989,6 +1991,7 @@ def save_config():
new_config['General']['process_last_cleanup'] = int(PROCESS_LAST_CLEANUP)
new_config['General']['move_associated_files'] = int(MOVE_ASSOCIATED_FILES)
new_config['General']['postpone_if_sync_files'] = int(POSTPONE_IF_SYNC_FILES)
new_config['General']['process_positive_log'] = int(PROCESS_POSITIVE_LOG)
new_config['General']['nfo_rename'] = int(NFO_RENAME)
new_config['General']['process_automatically'] = int(PROCESS_AUTOMATICALLY)
new_config['General']['unpack'] = int(UNPACK)

View file

@ -514,7 +514,7 @@ class ProcessTVShow(object):
for f in sorted(list(set([os.path.dirname(item) for item in work_files]) - {path}), key=len, reverse=True):
self._delete_folder(f)
def _bottom_line(text, log_level=logger.DEBUG):
def _bottom_line(text, log_level=logger.MESSAGE):
self._buffer('-' * len(text))
self._log_helper(text, log_level)
@ -524,11 +524,12 @@ class ProcessTVShow(object):
if self.any_vid_processed:
if not self.files_failed:
_bottom_line('Successfully processed.', logger.MESSAGE)
_bottom_line('Successfully processed.')
else:
_bottom_line(f'Successfully processed at least one video file'
f'{(", others were skipped", " and skipped another")[1 == self.files_failed]}.',
logger.MESSAGE)
f'{(", others were skipped", " and skipped another")[1 == self.files_failed]}.')
elif sickgear.PROCESS_POSITIVE_LOG:
_bottom_line('Success, no media to process.')
else:
_bottom_line('Failed! Did not process any files.', logger.WARNING)

View file

@ -8504,7 +8504,7 @@ class ConfigMediaProcess(Config):
unpack=None, keep_processed_dir=None, process_method=None,
extra_scripts='', sg_extra_scripts='',
rename_episodes=None, airdate_episodes=None,
move_associated_files=None, postpone_if_sync_files=None,
move_associated_files=None, postpone_if_sync_files=None, process_positive_log=None,
naming_custom_abd=None, naming_custom_sports=None, naming_custom_anime=None,
naming_strip_year=None, use_failed_downloads=None, delete_failed=None,
skip_removed_files=None, nfo_rename=None,
@ -8541,6 +8541,7 @@ class ConfigMediaProcess(Config):
sickgear.AIRDATE_EPISODES = config.checkbox_to_value(airdate_episodes)
sickgear.MOVE_ASSOCIATED_FILES = config.checkbox_to_value(move_associated_files)
sickgear.POSTPONE_IF_SYNC_FILES = config.checkbox_to_value(postpone_if_sync_files)
sickgear.PROCESS_POSITIVE_LOG = config.checkbox_to_value(process_positive_log)
sickgear.NAMING_CUSTOM_ABD = config.checkbox_to_value(naming_custom_abd)
sickgear.NAMING_CUSTOM_SPORTS = config.checkbox_to_value(naming_custom_sports)
sickgear.NAMING_CUSTOM_ANIME = config.checkbox_to_value(naming_custom_anime)