Change deprecate processEpisode used by nzbToMedia to advise how to configure API instead.

This commit is contained in:
JackDandy 2023-03-10 01:49:29 +00:00
parent a38ce36936
commit 68b8cbcdde
4 changed files with 14 additions and 10 deletions

View file

@ -8,6 +8,7 @@
* Change requirements for pure py3
* Change codebase cleanups
* Change improve perf by using generators with `any`
* Change deprecate processEpisode used by nzbToMedia to advise how to configure API instead
[develop changelog]

View file

@ -395,6 +395,13 @@
</div>
#end if
##
#if $sickgear.MEMCACHE.get('DEPRECATE_PP_LEGACY')
<div style="background-color:#a00; margin-top:35px; padding:5px 5px 1px 5px">
<p>Mar 2020: The `<em><span style="color:#fff">nzbToMedia</em></span>` script began using the <em><span style="color:#fff">secure</em></span> API to process media</p>
<p>Mar 2023: To remove this red box, please follow this <a target="_blank" href="https://github.com/SickGear/SickGear/wiki/FAQ-nzbToMedia"><span style="color:#fff">guidance</span></a></p>
</div>
#end if
##
#set $items = []
#try
#set void = $items.append($topmenu)

View file

@ -3932,16 +3932,13 @@ class HomeProcessMedia(Home):
return self._generic_message('Postprocessing results', f'<pre>{result}</pre>')
# noinspection PyPep8Naming
def processEpisode(self, dir_name=None, nzb_name=None, process_type=None, **kwargs):
""" legacy function name, stubbed but can _not_ be removed as this
is potentially used in pp scripts located outside of SG path (need to verify this)
@staticmethod
def processEpisode(**kwargs):
""" legacy function name, stubbed and will be removed
"""
kwargs['dir_name'] = dir_name or kwargs.pop('dir', None)
kwargs['nzb_name'] = nzb_name or kwargs.pop('nzbName', None)
kwargs['process_type'] = process_type or kwargs.pop('type', 'auto')
kwargs['pp_version'] = kwargs.pop('ppVersion', '0')
return self.process_files(**kwargs)
logger.error('This endpoint is no longer to be used,'
' nzbToMedia users please follow: https://github.com/SickGear/SickGear/wiki/FAQ-nzbToMedia')
sickgear.MEMCACHE['DEPRECATE_PP_LEGACY'] = True
class AddShows(Home):

View file

@ -216,7 +216,6 @@ class WebServer(threading.Thread):
# ----------------------------------------------------------------------------------------------------------
# legacy deprecated Aug 2019 - NEVER remove as used in external scripts
(r'%s/home/postprocess(/?.*)' % self.options['web_root'], webserve.HomeProcessMedia),
(r'%s(/?update_watched_state_kodi/?)' % self.options['web_root'], webserve.NoXSRFHandler),
# regular catchall routes - keep here at the bottom
(r'%s/home(/?.*)' % self.options['web_root'], webserve.Home),
(r'%s/manage/(/?.*)' % self.options['web_root'], webserve.Manage),