diff --git a/comictaggerlib/issueidentifier.py b/comictaggerlib/issueidentifier.py index ff9d973..9d07634 100644 --- a/comictaggerlib/issueidentifier.py +++ b/comictaggerlib/issueidentifier.py @@ -157,6 +157,7 @@ class IssueIdentifier: search_keys['issue_number'] = None search_keys['month'] = None search_keys['year'] = None + search_keys['issue_count'] = None if ca is None: return @@ -166,6 +167,7 @@ class IssueIdentifier: search_keys['issue_number'] = self.additional_metadata.issue search_keys['year'] = self.additional_metadata.year search_keys['month'] = self.additional_metadata.month + search_keys['issue_count'] = self.additional_metadata.issueCount return search_keys # see if the archive has any useful meta data for searching with @@ -211,6 +213,13 @@ class IssueIdentifier: search_keys['month'] = internal_metadata.month else: search_keys['month'] = md_from_filename.month + + if self.additional_metadata.issueCount is not None: + search_keys['issue_count'] = self.additional_metadata.issueCount + elif internal_metadata.issueCount is not None: + search_keys['issue_count'] = internal_metadata.issueCount + else: + search_keys['issue_count'] = md_from_filename.issueCount return search_keys @@ -389,6 +398,7 @@ class IssueIdentifier: length_approved = False publisher_approved = True date_approved = True + count_approved = True # remove any series that starts after the issue year if keys['year'] is not None and str(keys['year']).isdigit() and item['start_year'] is not None and str(item['start_year']).isdigit(): @@ -406,8 +416,13 @@ class IssueIdentifier: publisher = item['publisher']['name'] if publisher is not None and publisher.lower() in self.publisher_blacklist: publisher_approved = False + + # if we have a given issue count > 1, and the volume has count==1, remove it + # (for the case choosing limited series first issue vs a trade with the same cover) + #if item['count_of_issues'] == 1 and keys['issue_count'] is not None and keys['issue_count'] != 1: + # count_approved = False - if length_approved and publisher_approved and date_approved: + if length_approved and publisher_approved and date_approved and count_approved: series_second_round_list.append(item) # if we don't think it's an issue number 1, remove any series' that are one-shots diff --git a/comictaggerlib/taggerwindow.py b/comictaggerlib/taggerwindow.py index 0312abb..ff133f5 100644 --- a/comictaggerlib/taggerwindow.py +++ b/comictaggerlib/taggerwindow.py @@ -927,14 +927,17 @@ class TaggerWindow( QtGui.QMainWindow): else: QtGui.QMessageBox.information(self, self.tr("Online Search"), self.tr("Need to enter a series name to search.")) return - - + year = str(self.lePubYear.text()).strip() if year == "": year = None + issue_count = str(self.leIssueCount.text()).strip() + if issue_count == "": + issue_count = None + cover_index_list = self.metadata.getCoverPageIndexList() - selector = VolumeSelectionWindow( self, series_name, issue_number, year, cover_index_list, self.comic_archive, self.settings, autoselect ) + selector = VolumeSelectionWindow( self, series_name, issue_number, year, issue_count, cover_index_list, self.comic_archive, self.settings, autoselect ) title = "Search: '" + series_name + "' - " selector.setWindowTitle( title + "Select Series") diff --git a/comictaggerlib/volumeselectionwindow.py b/comictaggerlib/volumeselectionwindow.py index 7d5cf5c..048eb2d 100644 --- a/comictaggerlib/volumeselectionwindow.py +++ b/comictaggerlib/volumeselectionwindow.py @@ -87,7 +87,7 @@ class IdentifyThread( QtCore.QThread): class VolumeSelectionWindow(QtGui.QDialog): - def __init__(self, parent, series_name, issue_number, year, cover_index_list, comic_archive, settings, autoselect=False): + def __init__(self, parent, series_name, issue_number, year, issue_count, cover_index_list, comic_archive, settings, autoselect=False): super(VolumeSelectionWindow, self).__init__(parent) uic.loadUi(ComicTaggerSettings.getUIFile('volumeselectionwindow.ui' ), self) @@ -108,6 +108,7 @@ class VolumeSelectionWindow(QtGui.QDialog): self.series_name = series_name self.issue_number = issue_number self.year = year + self.issue_count = issue_count self.volume_id = 0 self.comic_archive = comic_archive self.immediate_autoselect = autoselect @@ -161,6 +162,7 @@ class VolumeSelectionWindow(QtGui.QDialog): md.series = self.series_name md.issue = self.issue_number md.year = self.year + md.issueCount = self.issue_count self.ii.setAdditionalMetadata( md ) self.ii.onlyUseAdditionalMetaData = True