Generate profile image for feeds if missing
This commit is contained in:
parent
91eff4ad07
commit
b307d4de03
@ -4,6 +4,7 @@ import { fetchArticlesByAuthor, fetchProfileEvent } from "../nostr.ts";
|
|||||||
import { profileAtomFeed } from "../feeds.ts";
|
import { profileAtomFeed } from "../feeds.ts";
|
||||||
import Profile from "../models/profile.ts";
|
import Profile from "../models/profile.ts";
|
||||||
import { notFoundHandler } from "../handlers/errors.ts";
|
import { notFoundHandler } from "../handlers/errors.ts";
|
||||||
|
import { generateOgProfileImage } from "../magick.ts";
|
||||||
|
|
||||||
const userAtomFeedHandler = async function (ctx: Context) {
|
const userAtomFeedHandler = async function (ctx: Context) {
|
||||||
const username = ctx.state.username;
|
const username = ctx.state.username;
|
||||||
@ -20,6 +21,7 @@ const userAtomFeedHandler = async function (ctx: Context) {
|
|||||||
const profile = new Profile(profileEvent, username);
|
const profile = new Profile(profileEvent, username);
|
||||||
|
|
||||||
if (profile.nip05) {
|
if (profile.nip05) {
|
||||||
|
await generateOgProfileImage(profile);
|
||||||
const articles = await fetchArticlesByAuthor(pubkey, 10);
|
const articles = await fetchArticlesByAuthor(pubkey, 10);
|
||||||
const atom = await profileAtomFeed(profile, articles);
|
const atom = await profileAtomFeed(profile, articles);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user