diff --git a/oxdata/poster/models.py b/oxdata/poster/models.py index 6d62bdf..f2d473d 100644 --- a/oxdata/poster/models.py +++ b/oxdata/poster/models.py @@ -76,7 +76,7 @@ class PosterCache(models.Model): name = hashlib.sha1(url).hexdigest() try: 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)) with open(self.image.path, 'w') as f: f.write(data)