From b8067feb349794f1645afc3a08c9f3cbeafcbfbf Mon Sep 17 00:00:00 2001 From: tr4ck3ur Date: Sun, 1 Jul 2018 13:24:48 +0200 Subject: [PATCH] Fixing thumbnails list --- jm2l/upload.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jm2l/upload.py b/jm2l/upload.py index 5a870d1..6e26b39 100644 --- a/jm2l/upload.py +++ b/jm2l/upload.py @@ -63,7 +63,10 @@ class MediaPath(): ress_url = '/image/%s/%d/%s' % (media_table, linked_id, f.replace(" ", "%20")) thumb_url = '/image/%s/%d/thumbnails/%s' % (media_table, linked_id, f.replace(" ","%20")) if MediaType is None: - filelist.append((ress_url, thumb_url)) + if os.path.exists(os.path.join(thumbpath, f +".jpg")): + filelist.append((ress_url, thumb_url +".jpg")) + else: + filelist.append((ress_url, thumb_url)) elif MediaType=='Image' and len( os.path.splitext(filename)[1] )==0: filelist.append((ress_url, thumb_url)) elif MediaType=='Other' and len( os.path.splitext(filename)[1] ):