From aca08c05e549af7eb8b5d358911199038395cc12 Mon Sep 17 00:00:00 2001 From: evilhero Date: Mon, 9 Jul 2018 16:37:28 -0400 Subject: [PATCH] FIX:(#2012) When importing, if that status of a previous import was 'No Results' would incorrectly display the Select option, When Importing and using the select checkboxes, ComicID's found and listed for the series selected were not being passed and weren't being used during the import sequence as a result --- data/interfaces/default/importresults.html | 4 ++-- mylar/webserve.py | 24 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/data/interfaces/default/importresults.html b/data/interfaces/default/importresults.html index 0202660c..b8484572 100755 --- a/data/interfaces/default/importresults.html +++ b/data/interfaces/default/importresults.html @@ -106,7 +106,7 @@ %> - + ${displayline} %if result['Status'] != 'Imported': @@ -139,7 +139,7 @@ [Import] %endif [Remove] - %if result['SRID'] is not None and result['Status'] != 'Imported': + %if all([result['SRID'] is not None, result['Status'] != 'Imported', result['Status'] != 'No Results']): [Select] %endif diff --git a/mylar/webserve.py b/mylar/webserve.py index 2dba706c..2b80ec82 100644 --- a/mylar/webserve.py +++ b/mylar/webserve.py @@ -2427,22 +2427,38 @@ class WebInterface(object): if action == 'importselected': logger.info('importing selected series.') for k,v in args.items(): - #k = Comicname[Volume] + #k = Comicname[Volume]|ComicID #v = DynamicName Volst = k.find('[') - volume = re.sub('[\[\]]', '', k[Volst:]).strip() + comicid_st = k.find('|') + if comicid_st == -1: + comicid = None + volume = re.sub('[\[\]]', '', k[Volst:]).strip() + else: + comicid = k[comicid_st+1:] + if comicid == 'None': + comicid = None + volume = re.sub('[\[\]]', '', k[Volst:comicid_st]).strip() ComicName = k[:Volst].strip() DynamicName = v cid = ComicName.decode('utf-8', 'replace') comicstoimport.append({'ComicName': cid, 'DynamicName': DynamicName, 'Volume': volume, - 'ComicID': None}) + 'ComicID': comicid}) elif action == 'removeimport': for k,v in args.items(): Volst = k.find('[') - volume = re.sub('[\[\]]', '', k[Volst:]).strip() + comicid_st = k.find('|') + if comicid_st == -1: + comicid = None + volume = re.sub('[\[\]]', '', k[Volst:]).strip() + else: + comicid = k[comicid_st+1:] + if comicid == 'None': + comicid = None + volume = re.sub('[\[\]]', '', k[Volst:comicid_st]).strip() ComicName = k[:Volst].strip() DynamicName = v if volume is None or volume == 'None':