mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-16 04:57:32 -06:00
panic normally
This commit is contained in:
parent
974e710f63
commit
3d965a8b99
1 changed files with 4 additions and 5 deletions
|
|
@ -878,7 +878,7 @@ func (a *accountDB) GetAccountFaves(ctx context.Context, accountID string) ([]*g
|
||||||
return *faves, nil
|
return *faves, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func qMediaOnly(ctx context.Context, q *bun.SelectQuery) *bun.SelectQuery {
|
func qMediaOnly(q *bun.SelectQuery) *bun.SelectQuery {
|
||||||
// Attachments are stored as a json object; this
|
// Attachments are stored as a json object; this
|
||||||
// implementation differs between SQLite and Postgres,
|
// implementation differs between SQLite and Postgres,
|
||||||
// so we have to be thorough to cover all eventualities
|
// so we have to be thorough to cover all eventualities
|
||||||
|
|
@ -896,8 +896,7 @@ func qMediaOnly(ctx context.Context, q *bun.SelectQuery) *bun.SelectQuery {
|
||||||
Where("? != '[]'", bun.Ident("status.attachments"))
|
Where("? != '[]'", bun.Ident("status.attachments"))
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log.Panicf(ctx, "dialect %d was neither pg nor sqlite", d)
|
panic("dialect " + d.String() + " was neither pg nor sqlite")
|
||||||
return q
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -944,7 +943,7 @@ func (a *accountDB) GetAccountStatuses(ctx context.Context, accountID string, li
|
||||||
|
|
||||||
// Respect media-only preference.
|
// Respect media-only preference.
|
||||||
if mediaOnly {
|
if mediaOnly {
|
||||||
q = qMediaOnly(ctx, q)
|
q = qMediaOnly(q)
|
||||||
}
|
}
|
||||||
|
|
||||||
if publicOnly {
|
if publicOnly {
|
||||||
|
|
@ -1086,7 +1085,7 @@ func (a *accountDB) GetAccountWebStatuses(
|
||||||
|
|
||||||
// Respect media-only preference.
|
// Respect media-only preference.
|
||||||
if mediaOnly {
|
if mediaOnly {
|
||||||
q = qMediaOnly(ctx, q)
|
q = qMediaOnly(q)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return only statuses LOWER (ie., older) than maxID
|
// Return only statuses LOWER (ie., older) than maxID
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue