Bug fixes, it should actually restart the download now

This commit is contained in:
mano3m
2012-08-01 02:38:00 +02:00
parent b262ed59a8
commit 4aae3c45ea
3 changed files with 23 additions and 5 deletions
+2 -2
View File
@@ -15,10 +15,10 @@ class Downloader(Plugin):
addEvent('download', self.download)
addEvent('getdownloadfailed', self.getdownloadfailed)
def download(self, data = {}):
def download(self, data = {}, movie = {}, manual = False, filedata = None):
pass
def getdownloadfailed(self, data = {}):
def getdownloadfailed(self, data = {}, movie = {}):
pass
def createNzbName(self, data, movie):
+2 -2
View File
@@ -65,8 +65,8 @@ class Sabnzbd(Downloader):
log.error("Unknown error: " + result[:40])
return False
def getdownloadfailed(self, data = {}, movie = {}, manual = False):
if self.isDisabled(manual) or not self.isCorrectType(data.get('type')):
def getdownloadfailed(self, data = {}, movie = {}):
if self.isDisabled(manual = True) or not self.isCorrectType(data.get('type')):
return
log.info('Checking download status of "%s" at SABnzbd.', data.get('name'))
+19 -1
View File
@@ -482,7 +482,13 @@ class Renamer(Plugin):
rels = db.query(Relea).filter_by(status_id = snatched_status.get('id'))
for rel in rels:
log.debug('Checking snatched release: %s' , rel.movie.library.titles[0].title)
# Get current selected title
default_title = ''
for title in rel.movie.library.titles:
if title.default: default_title = title.title
log.debug('Checking snatched movie: %s' , default_title)
item = {}
for info in rel.info:
@@ -506,6 +512,18 @@ class Renamer(Plugin):
db.commit()
# search/download again
# if downloaded manually: # this is currently not stored...
# log.info('Download of %s failed...', item['name'])
# return
#update movie to reflect release status update
mov = rel.movie.to_dict({
'profile': {'types': {'quality': {}}},
'releases': {'status': {}, 'quality': {}},
'library': {'titles': {}, 'files':{}},
'files': {}
})
log.info('Download of %s failed, trying next release...', item['name'])
fireEvent('searcher.single', mov)