diff --git a/gcd_talker/gcd.py b/gcd_talker/gcd.py index 27d6ee0..0a3d5a2 100644 --- a/gcd_talker/gcd.py +++ b/gcd_talker/gcd.py @@ -838,8 +838,11 @@ def _fetch_issue_data(self, series_id: int, issue_number: str) -> GenericMetadat sql_query: str = "" sql_base: str = "SELECT gcd_issue.id AS 'id' FROM gcd_issue " - sql_where: str = "WHERE gcd_issue.series_id=? AND gcd_issue.number=?" - sql_where_nn: str = "WHERE gcd_issue.series_id=? AND (gcd_issue.number=? OR gcd_issue.number='[nn]')" + sql_where: str = "WHERE gcd_issue.series_id=? AND gcd_issue.number=? AND gcd_issue.variant_of_id IS NULL " + sql_where_nn: str = ( + "WHERE gcd_issue.series_id=? AND gcd_issue.variant_of_id IS NULL AND " + "(gcd_issue.number=? OR gcd_issue.number='[nn]')" + ) if self.nn_is_issue_one and issue_number == "1": sql_query = sql_base + sql_where_nn