Band-aid fix for spaces with null fields in them

This commit is contained in:
Alessio 2024-07-14 13:24:44 -07:00
parent b4a4084b48
commit a9a7af2195

View File

@ -59,8 +59,10 @@ func (p Profile) fill_content(trove *TweetTrove, current_user_id UserID) {
if len(space_ids) > 0 { if len(space_ids) > 0 {
var spaces []Space var spaces []Space
err := p.DB.Select(&spaces, ` err := p.DB.Select(&spaces, `
select id, ifnull(created_by_id, 0) created_by_id, short_url, state, title, created_at, started_at, ended_at, updated_at, select id, ifnull(created_by_id, 0) created_by_id, short_url, state, title, ifnull(created_at, 0) created_at,
is_available_for_replay, replay_watch_count, live_listeners_count, is_details_fetched ifnull(started_at, 0) started_at, ifnull(ended_at, 0) ended_at, ifnull(updated_at, 0) updated_at,
ifnull(is_available_for_replay, 0) is_available_for_replay, ifnull(replay_watch_count, 0) replay_watch_count,
ifnull(live_listeners_count, 0) replay_watch_count, is_details_fetched
from spaces from spaces
where id in (`+strings.Repeat("?,", len(space_ids)-1)+`?)`, where id in (`+strings.Repeat("?,", len(space_ids)-1)+`?)`,
space_ids..., space_ids...,