use extension from url
This commit is contained in:
parent
e3ffa98d92
commit
ece58dad63
1 changed files with 1 additions and 1 deletions
|
@ -76,7 +76,7 @@ class PosterCache(models.Model):
|
||||||
name = hashlib.sha1(url).hexdigest()
|
name = hashlib.sha1(url).hexdigest()
|
||||||
try:
|
try:
|
||||||
data = ox.net.readUrl(url)
|
data = ox.net.readUrl(url)
|
||||||
self.image.name = poster_path(self.url, 'image.jpg')
|
self.image.name = poster_path(self.url, os.path.basename(url))
|
||||||
ox.makedirs(os.path.dirname(self.image.path))
|
ox.makedirs(os.path.dirname(self.image.path))
|
||||||
with open(self.image.path, 'w') as f:
|
with open(self.image.path, 'w') as f:
|
||||||
f.write(data)
|
f.write(data)
|
||||||
|
|
Loading…
Reference in a new issue