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('download', self.download)
|
||||||
addEvent('getdownloadfailed', self.getdownloadfailed)
|
addEvent('getdownloadfailed', self.getdownloadfailed)
|
||||||
|
|
||||||
def download(self, data = {}):
|
def download(self, data = {}, movie = {}, manual = False, filedata = None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def getdownloadfailed(self, data = {}):
|
def getdownloadfailed(self, data = {}, movie = {}):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def createNzbName(self, data, movie):
|
def createNzbName(self, data, movie):
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ class Sabnzbd(Downloader):
|
|||||||
log.error("Unknown error: " + result[:40])
|
log.error("Unknown error: " + result[:40])
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def getdownloadfailed(self, data = {}, movie = {}, manual = False):
|
def getdownloadfailed(self, data = {}, movie = {}):
|
||||||
if self.isDisabled(manual) or not self.isCorrectType(data.get('type')):
|
if self.isDisabled(manual = True) or not self.isCorrectType(data.get('type')):
|
||||||
return
|
return
|
||||||
|
|
||||||
log.info('Checking download status of "%s" at SABnzbd.', data.get('name'))
|
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'))
|
rels = db.query(Relea).filter_by(status_id = snatched_status.get('id'))
|
||||||
|
|
||||||
for rel in rels:
|
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 = {}
|
item = {}
|
||||||
for info in rel.info:
|
for info in rel.info:
|
||||||
@@ -506,6 +512,18 @@ class Renamer(Plugin):
|
|||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
# search/download again
|
# 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'])
|
log.info('Download of %s failed, trying next release...', item['name'])
|
||||||
fireEvent('searcher.single', mov)
|
fireEvent('searcher.single', mov)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user