Bug fixes, it should actually restart the download now
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user