Commit ae57c6d9 authored by echel0n's avatar echel0n
Browse files

Fixed issue with testing torrent and nzb search clients

Fixed issues with post-processing
parent e5240f08
......@@ -527,10 +527,8 @@ class ProcessResult(object):
if self.result:
self.log("Processing succeeded for " + cur_video_file_path)
else:
self.log("Processing failed for {0}: {1}".format(cur_video_file_path, process_fail_message),
sickrage.app.log.WARNING)
self.missed_files.append(
"{0} : Processing failed: {1}".format(cur_video_file_path, process_fail_message))
self.log("Processing failed for {0}: {1}".format(cur_video_file_path, process_fail_message), sickrage.app.log.WARNING)
self.missed_files.append("{0} : Processing failed: {1}".format(cur_video_file_path, process_fail_message))
self.succeeded = False
def process_failed(self, dirName, nzbName):
......
......@@ -698,7 +698,7 @@ class PostProcessor(object):
sickrage.app.log.debug("Unable to parse, skipping: {}".format(e))
continue
if not cur_show_id or not series_provider_id:
if not cur_show_id or not cur_series_provider_id:
continue
series_id = cur_show_id
......@@ -783,8 +783,7 @@ class PostProcessor(object):
:param ep_obj: The object to use when calling the extra script
"""
for curScriptName in sickrage.app.config.general.extra_scripts.split('|'):
for curScriptName in [x for x in sickrage.app.config.general.extra_scripts.split('|') if x]:
# generate a safe command line string to execute the script and provide all the parameters
script_cmd = [piece for piece in re.split("( |\\\".*?\\\"|'.*?')", curScriptName) if piece.strip()]
script_cmd[0] = os.path.abspath(script_cmd[0])
......
......@@ -19,12 +19,13 @@
# along with SiCKRAGE. If not, see <http://www.gnu.org/licenses/>.
# ##############################################################################
import os
import time
import traceback
from enum import Enum
import sickrage
from sickrage.core.process_tv import ProcessResult
from sickrage.core.queues import Queue, Task, TaskPriority
from sickrage.core.queues import Queue, Task, TaskPriority, TaskStatus
class PostProcessorTaskActions(Enum):
......@@ -117,8 +118,10 @@ class PostProcessorQueue(Queue):
PostProcessorTask(dirName, nzbName, process_method, force, is_priority, delete_on, failed, proc_type))
if force_next:
result = self.get_result(task_id) or ""
return result
while self.check_status(task_id) not in [TaskStatus.FINISHED, TaskStatus.FAILED]:
time.sleep(1)
return self.get_result(task_id)
self.log("{} post-processing job for {} has been added to the queue".format(proc_type.title(), dirName))
return self.output + "<p><span class='hidden'>Processing succeeded</span></p>"
......
......@@ -34,7 +34,7 @@ import sickrage
from sickrage.clients import get_client_instance
from sickrage.clients.nzb.sabnzbd import SabNZBd
from sickrage.core.common import Overview, Quality, Qualities
from sickrage.core.enums import SeriesProviderID
from sickrage.core.enums import SeriesProviderID, TorrentMethod, NzbMethod
from sickrage.core.exceptions import (
AnidbAdbaConnectionException,
CantRefreshShowException,
......@@ -195,7 +195,7 @@ class TestSynologyDSMHandler(BaseHandler, ABC):
username = self.get_argument('username')
password = self.get_argument('password')
client = get_client_instance(nzb_method, client_type='nzb')
client = get_client_instance(NzbMethod[nzb_method].value, client_type='nzb')
__, access_msg = client(host, username, password).test_authentication()
return self.write(access_msg)
......@@ -208,7 +208,7 @@ class TestTorrentHandler(BaseHandler, ABC):
username = self.get_argument('username')
password = self.get_argument('password')
client = get_client_instance(torrent_method, client_type='torrent')
client = get_client_instance(TorrentMethod[torrent_method].value, client_type='torrent')
__, access_msg = client(host, username, password).test_authentication()
return self.write(access_msg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment