Fix episode list

This commit is contained in:
2025-06-07 14:08:42 +09:00
parent bc2be914df
commit 53a408d074
4 changed files with 38 additions and 3 deletions

View File

@ -193,6 +193,27 @@ export async function getFeedByUrl(url: string): Promise<Feed | null> {
}
}
export async function getFeedById(id: string): Promise<Feed | null> {
try {
const stmt = db.prepare("SELECT * FROM feeds WHERE id = ?");
const row = stmt.get(id) as any;
if (!row) return null;
return {
id: row.id,
url: row.url,
title: row.title,
description: row.description,
lastUpdated: row.last_updated,
createdAt: row.created_at,
active: Boolean(row.active),
};
} catch (error) {
console.error("Error getting feed by ID:", error);
throw error;
}
}
export async function getAllFeeds(): Promise<Feed[]> {
try {
const stmt = db.prepare(