Fixed: force search for wanted albums only searching for the first album

This commit is contained in:
Remy Varma
2012-01-25 13:33:09 +00:00
parent ec63edc7da
commit 644c8e5133

View File

@@ -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)