Update
This commit is contained in:
19
server.ts
19
server.ts
@ -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(
|
||||
|
Reference in New Issue
Block a user