From 8ac560f9402b05f2811bf8207338110f01e2e576 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Tue, 23 May 2017 12:19:33 +0200 Subject: [PATCH] skip *_o.jpg when updating covers --- apps/cover/management/commands/refresh_covers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/cover/management/commands/refresh_covers.py b/apps/cover/management/commands/refresh_covers.py index 2c78db9b..1097a754 100644 --- a/apps/cover/management/commands/refresh_covers.py +++ b/apps/cover/management/commands/refresh_covers.py @@ -21,8 +21,8 @@ class Command(BaseCommand): def handle(self, *args, **options): from_id = options.get('from_id', 1) for image in Image.objects.filter(id__gte=from_id).exclude(book=None).order_by('id'): - print image.id - if image.source_url and 'flickr.com' in image.source_url: + if image.source_url and 'flickr.com' in image.source_url and not image.download_url.endswith('_o.jpg'): + print image.id try: flickr_data = get_flickr_data(image.source_url) print flickr_data -- 2.20.1