fix: backend and discord-gateway improvements
- Update shared database schema - Add shared utils - Refactor backend middleware, auth routes, and dashboard repository - Improve media analysis client with better error handling - Fix searxng search URL construction - Update URL fetcher for robustness Co-authored-by: workflow agents
This commit is contained in:
co-authored by
workflow agents
parent
81a004d250
commit
ade5d6a7c3
@@ -43,9 +43,10 @@ export class DashboardRepository {
|
||||
// Top channels by message count
|
||||
const topChannels = await pool.query(`
|
||||
SELECT channel_id,
|
||||
(metadata::jsonb -> 'channel' ->> 'channelName') AS channel_name,
|
||||
COALESCE(NULLIF((metadata::jsonb -> 'channel' ->> 'channelName'), ''), channel_id) AS channel_name,
|
||||
COUNT(*)::int AS message_count
|
||||
FROM messages
|
||||
WHERE metadata IS NOT NULL AND metadata != ''
|
||||
GROUP BY channel_id, (metadata::jsonb -> 'channel' ->> 'channelName')
|
||||
ORDER BY COUNT(*) DESC
|
||||
LIMIT 10
|
||||
|
||||
Reference in New Issue
Block a user