From 7a9a47f11f1c139df3bd689e51e511aef63db8a1 Mon Sep 17 00:00:00 2001 From: Interitio Date: Thu, 30 Oct 2025 22:23:49 +1000 Subject: [PATCH] fix: More typos in raw data query --- subathon/subathon.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/subathon/subathon.py b/subathon/subathon.py index 856eb1f..bb702f0 100644 --- a/subathon/subathon.py +++ b/subathon/subathon.py @@ -161,7 +161,7 @@ class ActiveSubathon: result = await ( SubathonContribution.table.select_where( - subathoid=self.subathondata.subathon_id + subathon_id=self.subathondata.subathon_id ) .join( "subscribe_events", @@ -172,11 +172,11 @@ class ActiveSubathon: .with_no_adapter() ) - total_points += result["total"] + total_points += result[0]["total"] or 0 result = await ( SubathonContribution.table.select_where( - subathoid=self.subathondata.subathon_id + subathon_id=self.subathondata.subathon_id ) .join( "subscribe_message_events", @@ -187,14 +187,14 @@ class ActiveSubathon: .with_no_adapter() ) - total_points += result["total"] + total_points += result[0]["total"] or 0 result = await ( SubathonContribution.table.select_where( - subathoid=self.subathondata.subathon_id + subathon_id=self.subathondata.subathon_id ) .join( - "subscribe_gift_events", + "gift_events", using=("event_id",), join_type=JOINTYPE.INNER, ) @@ -202,7 +202,7 @@ class ActiveSubathon: .with_no_adapter() ) - total_points += result["total"] + total_points += result[0]["total"] or 0 return total_points @@ -213,7 +213,7 @@ class ActiveSubathon: """ result = await ( SubathonContribution.table.select_where( - subathoid=self.subathondata.subathon_id + subathon_id=self.subathondata.subathon_id ) .join( "bits_events", @@ -223,7 +223,7 @@ class ActiveSubathon: .select(total="SUM(bits)") .with_no_adapter() ) - return result["total"] + return result[0]["total"] or 0 class SubathonRegistry: