From 644c8e5133b5a76d7fc4546ed3a7feacaa435f00 Mon Sep 17 00:00:00 2001 From: Remy Varma Date: Wed, 25 Jan 2012 13:33:09 +0000 Subject: [PATCH] Fixed: force search for wanted albums only searching for the first album --- headphones/searcher.py | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index 144636c4..9bc85d87 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -60,12 +60,30 @@ def url_fix(s, charset='utf-8'): def searchforalbum(albumid=None, new=False): - foundNZB = "none" - if (headphones.NZBMATRIX or headphones.NEWZNAB or headphones.NZBSORG or headphones.NEWZBIN) and (headphones.SAB_HOST or headphones.BLACKHOLE): - foundNZB = searchNZB(albumid, new) + + if not albumid: - if foundNZB == "none": - searchTorrent(albumid, new) + myDB = db.DBConnection() + + results = myDB.select('SELECT AlbumID from albums WHERE Status="Wanted"') + new = True + + for result in results: + foundNZB = "none" + if (headphones.NZBMATRIX or headphones.NEWZNAB or headphones.NZBSORG or headphones.NEWZBIN) and (headphones.SAB_HOST or headphones.BLACKHOLE): + foundNZB = searchNZB(result['AlbumID'], new) + + if foundNZB == "none": + searchTorrent(result['AlbumID'], new) + + else: + + foundNZB = "none" + if (headphones.NZBMATRIX or headphones.NEWZNAB or headphones.NZBSORG or headphones.NEWZBIN) and (headphones.SAB_HOST or headphones.BLACKHOLE): + foundNZB = searchNZB(albumid, new) + + if foundNZB == "none": + searchTorrent(albumid, new)