From 37e5f2c48bd8ce2eeed53894ac9fb15e6a742f45 Mon Sep 17 00:00:00 2001 From: mano3m Date: Sun, 20 Oct 2013 01:50:06 +0200 Subject: [PATCH] Fix SabNZBd folder bug If only one file is extracted the storage key contains the extracted file instead of the folder. This leads to CPS skipping the renamer. This check fixes that. --- couchpotato/core/downloaders/sabnzbd/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/downloaders/sabnzbd/main.py b/couchpotato/core/downloaders/sabnzbd/main.py index de09796..dcbe245 100644 --- a/couchpotato/core/downloaders/sabnzbd/main.py +++ b/couchpotato/core/downloaders/sabnzbd/main.py @@ -6,6 +6,7 @@ from couchpotato.environment import Env from datetime import timedelta from urllib2 import URLError import json +import os import traceback log = CPLog(__name__) @@ -117,7 +118,7 @@ class Sabnzbd(Downloader): 'status': status, 'original_status': nzb['status'], 'timeleft': str(timedelta(seconds = 0)), - 'folder': ss(nzb['storage']), + 'folder': os.path.dirname(ss(nzb['storage'])) if os.path.isfile(ss(nzb['storage'])) else ss(nzb['storage']), }) return release_downloads