fix: Join type in lb query.
This commit is contained in:
@@ -6,7 +6,7 @@ import twitchio
|
|||||||
from twitchio import PartialUser, Scopes, eventsub
|
from twitchio import PartialUser, Scopes, eventsub
|
||||||
from twitchio.ext import commands as cmds
|
from twitchio.ext import commands as cmds
|
||||||
|
|
||||||
from data.queries import ORDER
|
from data.queries import JOINTYPE, ORDER
|
||||||
from meta import Bot, Context
|
from meta import Bot, Context
|
||||||
from meta.sockets import Channel, register_channel
|
from meta.sockets import Channel, register_channel
|
||||||
from utils.lib import utc_now, strfdelta
|
from utils.lib import utc_now, strfdelta
|
||||||
@@ -522,12 +522,13 @@ class SubathonComponent(cmds.Component):
|
|||||||
name = None
|
name = None
|
||||||
pid = None
|
pid = None
|
||||||
await active.add_contribution(pid, amount, None)
|
await active.add_contribution(pid, amount, None)
|
||||||
|
await self.channel.send_updates(cid)
|
||||||
|
|
||||||
# Build message
|
# Build message
|
||||||
if amount > 0:
|
if amount > 0:
|
||||||
amountstr = f"Added {amount} point(s) to the timer"
|
amountstr = f"Added {amount} point(s) to the timer"
|
||||||
elif amount < 0:
|
elif amount < 0:
|
||||||
amountstr = f"Removed {amount} point(s) from the timer"
|
amountstr = f"Removed {-amount} point(s) from the timer"
|
||||||
else:
|
else:
|
||||||
amountstr = "Did nothing to the timer"
|
amountstr = "Did nothing to the timer"
|
||||||
|
|
||||||
@@ -553,7 +554,7 @@ class SubathonComponent(cmds.Component):
|
|||||||
if (active := await self.get_active_subathon(cid)) is not None:
|
if (active := await self.get_active_subathon(cid)) is not None:
|
||||||
# Get totals for all contributors
|
# Get totals for all contributors
|
||||||
query = self.data.subathon_contributions.select_where(subathon_id=active.subathondata.subathon_id)
|
query = self.data.subathon_contributions.select_where(subathon_id=active.subathondata.subathon_id)
|
||||||
query.join('user_profiles', using=('profileid',))
|
query.join('user_profiles', using=('profileid',), join_type=JOINTYPE.LEFT)
|
||||||
query.select('subathon_id', 'profileid', total="SUM(score)")
|
query.select('subathon_id', 'profileid', total="SUM(score)")
|
||||||
query.order_by('total', direction=ORDER.DESC)
|
query.order_by('total', direction=ORDER.DESC)
|
||||||
query.group_by('subathon_id', 'profileid')
|
query.group_by('subathon_id', 'profileid')
|
||||||
|
|||||||
Reference in New Issue
Block a user