Skip to content

Commit

Permalink
Use iterator to export feed to opml
Browse files Browse the repository at this point in the history
Signed-off-by: m4rc3l05 <[email protected]>
  • Loading branch information
M4RC3L05 committed May 29, 2024
1 parent 2c71670 commit 15f338a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apps/api/routes/opml/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ export const exportFeeds = (router: Hono) => {

const categories = c
.get("database")
.all<{ id: string; name: string }>(sql`select * from categories`);
.getPrepared<{ id: string; name: string }>(sql`select * from categories`);

for (const category of categories) {
const text = escape(category.name);
doc += `<outline text="${text}">`;

const feeds = c
.get("database")
.all<{ name: string; url: string }>(
.getPrepared<{ name: string; url: string }>(
sql`select * from feeds where category_id = ${category.id}`,
);

Expand Down

0 comments on commit 15f338a

Please sign in to comment.