Merge branch 'feature/ChangeNZBGetPP' into dev

This commit is contained in:
JackDandy 2023-02-09 14:45:38 +00:00
commit a33ec92476
2 changed files with 9 additions and 2 deletions

View file

@ -27,6 +27,7 @@
* Update tmdbsimple 2.6.6 (679e343) to 2.9.1 (9da400a)
* Update torrent_parser 0.3.0 (2a4eecb) to 0.4.0 (23b9e11)
* Update unidecode module 1.1.1 (632af82) to 1.3.6 (4141992)
* Change prevent included py3 requests module failure on NZBGet systems that by default, run py2 with py2 requests
* Change prevent included py3 requests module failure on SABnzbd systems that by default, run py2 with py2 requests

View file

@ -51,7 +51,7 @@
# Send "Process Media" requests to SickGear
#
# Process Media extension version: 2.7.
# Process Media extension version: 2.8.
# <!--
# For more info and updates please visit forum topic at
# -->
@ -444,13 +444,19 @@ if not sg_path or not Ek.ek(os.path.isdir, sg_path):
sg_path = Ek.ek(os.path.dirname, Ek.ek(os.path.dirname, script_path))
except (BaseException, Exception):
pass
if sg_path and Ek.ek(os.path.isdir, Ek.ek(os.path.join, sg_path, 'lib')):
if not PY2 and sg_path and Ek.ek(os.path.isdir, Ek.ek(os.path.join, sg_path, 'lib')):
sys.path.insert(1, Ek.ek(os.path.join, sg_path, 'lib'))
py_msg = 'Python 3 %s be set to run python files instead of the current Python 2.'
try:
import requests
if PY2:
Logger.log(py_msg % 'should', Logger.WARNING)
except ImportError:
if PY2:
Logger.log(py_msg % 'must', Logger.ERROR)
sys.exit(1)
# Logger.log('You must set SickGear sg_base_path in script config or install python requests library', Logger.ERROR)
Logger.log('You must install python requests library', Logger.ERROR)
sys.exit(1)