@@ -44,9 +44,20 @@ class CoverDownloader(object):
4444 def __init__ (self , core ):
4545 self .core = core
4646
47- def get_cover (self , podcast , download = False ):
48- filename = podcast .cover_file
49- cover_url = podcast .cover_url
47+ def get_cover (self , podcast , download = False , episode = None ):
48+ if episode != None :
49+ # Get episode art.
50+ filename = episode .art_file
51+ cover_url = episode .episode_art_url
52+ if cover_url is None :
53+ return None
54+ else :
55+ # Get podcast cover.
56+ filename = podcast .cover_file
57+ cover_url = podcast .cover_url
58+
59+ username = podcast .auth_username
60+ password = podcast .auth_password
5061
5162 # Return already existing files
5263 for extension in self .EXTENSIONS :
@@ -62,8 +73,7 @@ def get_cover(self, podcast, download=False):
6273
6374 # We have to add username/password, because password-protected
6475 # feeds might keep their cover art also protected (bug 1521)
65- cover_url = util .url_add_authentication (cover_url , podcast .auth_username ,
66- podcast .auth_password )
76+ cover_url = util .url_add_authentication (cover_url , username , password )
6777
6878 try :
6979 logger .info ('Downloading cover art: %s' , cover_url )
0 commit comments