From 1cee196886bfe914e0d0953ce19927d28987dd3e Mon Sep 17 00:00:00 2001 From: Mizaki Date: Sat, 10 Aug 2024 20:36:26 +0100 Subject: [PATCH] Fix incorrect logging of multiple issues for single series id --- gcd_talker/gcd.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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