From 988bc8d455d4279f0fe8eb52668e090988558fb3 Mon Sep 17 00:00:00 2001 From: evilhero Date: Tue, 12 Mar 2019 15:49:33 -0400 Subject: [PATCH] FIX: fix for issue display popup not showing issue image when cbz file had files within ending with the word 'copy' --- mylar/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mylar/helpers.py b/mylar/helpers.py index c77915bd..4fdc9aa0 100755 --- a/mylar/helpers.py +++ b/mylar/helpers.py @@ -1530,7 +1530,7 @@ def IssueDetails(filelocation, IssueID=None, justinfo=False): cover = "found" break - elif any(['001.jpg' in infile, '001.png' in infile, '001.webp' in infile, '01.jpg' in infile, '01.png' in infile, '01.webp' in infile]) and cover == "notfound": + elif (any(['001.jpg' in infile, '001.png' in infile, '001.webp' in infile, '01.jpg' in infile, '01.png' in infile, '01.webp' in infile]) or ('0001' in infile and infile.endswith(pic_extensions))) and cover == "notfound": logger.fdebug('Extracting primary image ' + infile + ' as coverfile for display.') local_file = open(os.path.join(mylar.CONFIG.CACHE_DIR, 'temp.jpg'), "wb") local_file.write(inzipfile.read(infile)) @@ -1540,6 +1540,7 @@ def IssueDetails(filelocation, IssueID=None, justinfo=False): if cover != "found": logger.fdebug('Invalid naming sequence for jpgs discovered. Attempting to find the lowest sequence and will use as cover (it might not work). Currently : ' + str(low_infile)) local_file = open(os.path.join(mylar.CONFIG.CACHE_DIR, 'temp.jpg'), "wb") + logger.fdebug('infile_name used for displaying: %s' % low_infile_name) local_file.write(inzipfile.read(low_infile_name)) local_file.close cover = "found"