From ece58dad63a69bcc68bd31703fd014e1f8eecd2a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 5 Jul 2012 15:51:57 +0200 Subject: [PATCH] use extension from url --- oxdata/poster/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)