If data is empty, assume correct type for downloaders

This commit is contained in:
Ruud
2013-01-20 21:11:36 +01:00
parent faaf351662
commit f8b4e75b74

View File

@@ -106,4 +106,6 @@ class Downloader(Provider):
def isEnabled(self, manual, data = {}):
d_manual = self.conf('manual', default = False)
return super(Downloader, self).isEnabled() and ((d_manual and manual) or (d_manual is False)) and self.isCorrectType(data.get('type'))
return super(Downloader, self).isEnabled() and \
((d_manual and manual) or (d_manual is False)) and \
(not data or self.isCorrectType(data.get('type')))