This commit is contained in:
2025-06-08 15:38:57 +09:00
parent 40e3754628
commit 2e41b3ac70
2 changed files with 45 additions and 10 deletions

View File

@ -266,6 +266,25 @@ app.get("/api/feeds/:feedId/episodes", async (c) => {
}
});
app.get("/api/episode-with-source/:episodeId", async (c) => {
try {
const episodeId = c.req.param("episodeId");
const { fetchEpisodeWithSourceInfo } = await import(
"./services/database.js"
);
const episode = await fetchEpisodeWithSourceInfo(episodeId);
if (!episode) {
return c.json({ error: "Episode not found" }, 404);
}
return c.json({ episode });
} catch (error) {
console.error("Error fetching episode with source info:", error);
return c.json({ error: "Failed to fetch episode with source info" }, 500);
}
});
app.get("/api/episodes-with-feed-info", async (c) => {
try {
const { fetchEpisodesWithFeedInfo } = await import(