The recipes.blue monorepo recipes.blue
recipes appview atproto
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: return recipe image blob url

+4 -2
+4 -2
apps/api/src/xrpc/index.ts
··· 1 1 import { Hono } from 'hono'; 2 2 import { db, recipeTable } from '@cookware/database'; 3 3 import { and, desc, eq, sql } from 'drizzle-orm'; 4 - import { DID, getDidDoc, getDidFromHandleOrDid } from '@cookware/lexicons'; 4 + import { DID, getDidFromHandleOrDid } from '@cookware/lexicons'; 5 5 import { simpleFetchHandler, XRPC } from '@atcute/client'; 6 - import { AppBskyActorProfile } from '@atproto/api'; 7 6 import { BlueRecipesFeedDefs, BlueRecipesFeedGetRecipes } from '@atcute/client/lexicons'; 8 7 import { getAuthorInfo } from '../util/api.js'; 9 8 ··· 26 25 stepsCount: sql`json_array_length(${recipeTable.steps})`, 27 26 createdAt: recipeTable.createdAt, 28 27 authorDid: recipeTable.authorDid, 28 + imageRef: recipeTable.imageRef, 29 29 uri: sql`concat(${recipeTable.authorDid}, "/", ${recipeTable.rkey})`.as('uri'), 30 30 }) 31 31 .from(recipeTable) ··· 52 52 description: r.description || undefined, 53 53 ingredients: r.ingredientsCount as number, 54 54 steps: r.stepsCount as number, 55 + imageUrl: `https://cdn.bsky.app/img/feed_thumbnail/plain/${r.authorDid}/${r.imageRef}@jpeg`, 55 56 }); 56 57 57 58 for (const result of recipes) { ··· 111 112 description: recipe.description, 112 113 ingredients: recipe.ingredients, 113 114 steps: recipe.steps, 115 + imageUrl: `https://cdn.bsky.app/img/feed_thumbnail/plain/${recipe.authorDid}/${recipe.imageRef}@jpeg`, 114 116 }, 115 117 }); 116 118 });