Catch all rss

This commit is contained in:
Ichitux
2026-04-07 20:17:36 +02:00
parent 1afa7d0c17
commit 42bd57161d
2 changed files with 39 additions and 3 deletions

View File

@@ -126,6 +126,25 @@ export function getAllChannels() {
return results;
}
export function getAllMessages(limit = 50) {
const stmt = db.prepare(
`SELECT * FROM messages
ORDER BY created_at DESC
LIMIT ?`
);
stmt.bind([limit]);
const results = [];
while (stmt.step()) {
const row = stmt.getAsObject();
results.push(row);
}
stmt.free();
return results;
}
export function getLatestMessageTime(channelId) {
const stmt = db.prepare(
`SELECT MAX(created_at) as latest FROM messages WHERE channel_id = ?`