From be0efb97c6c38d76444b9ecec85585f4d6117185 Mon Sep 17 00:00:00 2001 From: mano3m Date: Tue, 28 Aug 2012 18:05:17 +0200 Subject: [PATCH] The searcher states that a better quality is already available or snatched after a release just failed downloading and was set to ignored. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After refreshing the wanted page, one release showed as ignored, the others as available. After clicking the green 'download another one' button, it started downloading the next one. This is because the movie_dict is filled before the release is updated to ignored and therefore still is stated as snatched in searcher.single. 08-28 17:05:13 DEBUG [ato.core.plugins.searcher] Checking status snatched releases... 08-28 17:05:13 DEBUG [ato.core.plugins.searcher] Checking snatched movie: Think Like A Man 08-28 17:05:13 INFO [.core.downloaders.sabnzbd] Checking download status of "Think Like A Man 2012 1080p BluRay X264 BLOW.cp(tt1621045)" at SABnzbd. 08-28 17:05:13 INFO [hpotato.core.plugins.base] Opening url: http://localhost:8000/api?output=json&apikey=xxx&mode=queue, params: [] 08-28 17:05:13 INFO [hpotato.core.plugins.base] Opening url: http://localhost:8000/api?output=json&apikey=xxx&mode=history, params: [] 08-28 17:05:14 DEBUG [.core.downloaders.sabnzbd] Found Think Like A Man 2012 1080p BluRay X264 BLOW.cp(tt1621045) in SabNZBd history, which has Moving 08-28 17:05:14 INFO [.core.downloaders.sabnzbd] Think Like A Man 2012 1080p BluRay X264 BLOW.cp(tt1621045) failed downloading, deleting... 08-28 17:05:14 INFO [hpotato.core.plugins.base] Opening url: http://localhost:8000/api?del_files=1&apikey=xxx&mode=history&value=SABnzbd_nzo_tmhk8y&name=delete, params: [] 08-28 17:05:14 DEBUG [.core.downloaders.sabnzbd] Result text from SAB: ok 08-28 17:05:14 INFO [.core.downloaders.sabnzbd] SabNZBd deleted failed release Think Like A Man 2012 1080p BluRay X264 BLOW.cp(tt1621045) successfully. 08-28 17:05:14 DEBUG [ato.core.plugins.searcher] Download status: failed 08-28 17:05:14 INFO [ato.core.plugins.searcher] Trying next release for: Think Like A Man 08-28 17:05:14 INFO [ato.core.plugins.searcher] Better quality (1080P) already available or snatched for Think Like A Man 08-28 17:05:14 DEBUG [potato.core.plugins.movie] Changing status for Think Like A Man 08-28 17:06:13 DEBUG [ato.core.plugins.searcher] Checking status snatched releases... --- couchpotato/core/plugins/searcher/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py index bdc95881..dfef760a 100644 --- a/couchpotato/core/plugins/searcher/main.py +++ b/couchpotato/core/plugins/searcher/main.py @@ -529,8 +529,6 @@ class Searcher(Plugin): ignored_status = fireEvent('status.get', 'ignored', single = True) try: - movie_dict = fireEvent('movie.get', movie_id, single = True) - db = get_session() rels = db.query(Release).filter_by( status_id = snatched_status.get('id'), @@ -541,6 +539,7 @@ class Searcher(Plugin): rel.status_id = ignored_status.get('id') db.commit() + movie_dict = fireEvent('movie.get', movie_id, single = True) log.info('Trying next release for: %s', getTitle(movie_dict['library'])) fireEvent('searcher.single', movie_dict)