From b19b0775c7ca540c42a2fe9ed7aa36a43767689d Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 20 Feb 2015 22:16:12 +0100 Subject: [PATCH] Force update to new poster on refresh fix #4671 --- couchpotato/core/media/__init__.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/media/__init__.py b/couchpotato/core/media/__init__.py index 7a178b8..0d98600 100755 --- a/couchpotato/core/media/__init__.py +++ b/couchpotato/core/media/__init__.py @@ -1,9 +1,10 @@ import os import traceback -from couchpotato import CPLog +from couchpotato import CPLog, md5 from couchpotato.core.event import addEvent, fireEvent, fireEventAsync from couchpotato.core.helpers.encoding import toUnicode +from couchpotato.core.helpers.variable import getExt from couchpotato.core.plugins.base import Plugin import six @@ -92,7 +93,15 @@ class MediaBase(Plugin): if not isinstance(image, (str, unicode)): continue - if file_type not in existing_files or len(existing_files.get(file_type, [])) == 0: + # Check if it has top image + filename = '%s.%s' % (md5(image), getExt(image)) + existing = existing_files.get(file_type, []) + has_latest = False + for x in existing: + if filename in x: + has_latest = True + + if not has_latest or file_type not in existing_files or len(existing_files.get(file_type, [])) == 0: file_path = fireEvent('file.download', url = image, single = True) if file_path: existing_files[file_type] = [toUnicode(file_path)]