[READ ONLY MIRROR] Spark Social AppView Server github.com/sprksocial/server
atproto deno hono lexicon
5
fork

Configure Feed

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

use new cdn for everything

+10 -14
+2 -4
services/appview/src/feed/feed.ts
··· 83 83 const likeCount = likeCounts.get(record.uri) || 0 84 84 const blobCid: CID = (record.value as any).embed?.video?.ref 85 85 86 - const pdsDomain = new URL(pdsUrl).hostname 87 - 88 86 return { 89 87 post: { 90 88 uri: record.uri, ··· 105 103 embed: { 106 104 $type: 'so.sprk.embed.video#view', 107 105 cid: record.cid, 108 - playlist: `https://videocdn.sprk.so/${pdsDomain}/${actorDid}/${blobCid.toString()}`, 109 - thumbnail: `https://cdn.sprk.so/${actorDid}/${blobCid.toString()}/thumbnail`, 106 + playlist: `https://media.sprk.so/video/${actorDid}/${blobCid.toString()}`, 107 + thumbnail: `https://thumb.sprk.so/${actorDid}/${blobCid.toString()}/thumbnail`, 110 108 }, 111 109 replyCount: 0, 112 110 repostCount: 0,
+3 -3
services/appview/src/routes/actor/getProfile.ts
··· 139 139 handle, 140 140 displayName: p.displayName, 141 141 avatar: p.avatar 142 - ? `https://cdn.sprk.so/avatar/${p.authorDid}` 142 + ? `https://media.sprk.so/avatar/tiny/${p.authorDid}/${p.avatar.ref.$link}/webp` 143 143 : undefined, 144 144 } as SoSprkActorDefs.ProfileViewBasic 145 145 }), ··· 174 174 175 175 // Get avatar and banner URLs 176 176 const avatar = profile.avatar 177 - ? `https://cdn.sprk.so/avatar/${actorDid}/${profile.avatar.ref.$link}` 177 + ? `https://media.sprk.so/avatar/tiny/${actorDid}/${profile.avatar.ref.$link}/webp` 178 178 : undefined 179 179 const banner = profile.banner 180 - ? `https://cdn.sprk.so/banner/${actorDid}/${profile.banner.ref.$link}` 180 + ? `https://media.sprk.so/img/tiny/${actorDid}/${profile.banner.ref.$link}/webp` 181 181 : undefined 182 182 183 183 // Convert joinedViaStarterPack to the correct type if it exists
+5 -7
services/appview/src/utils/post-transformer.ts
··· 40 40 did: post.authorDid, 41 41 handle: post.authorHandle, 42 42 displayName: profile?.displayName ?? post.authorHandle, 43 - avatar: `https://cdn.sprk.so/avatar/${post.authorDid}`, 43 + avatar: `https://media.sprk.so/avatar/tiny/${profile?.authorDid}/${profile?.avatar?.ref?.$link}/webp`, 44 44 } 45 45 46 46 let embed ··· 49 49 embed = { 50 50 $type: 'so.sprk.embed.images#view', 51 51 images: post.embed.images.map((img: any) => ({ 52 - thumb: `https://cdn.bsky.app/img/feed_thumbnail/plain/${post.authorDid}/${img.image.ref.$link}@jpeg`, 53 - fullsize: `https://cdn.bsky.app/img/feed_fullsize/plain/${post.authorDid}/${img.image.ref.$link}@jpeg`, 52 + thumb: `https://media.bsky.app/img/medium/${post.authorDid}/${img.image.ref.$link}/webp`, 53 + fullsize: `https://media.bsky.app/img/full/${post.authorDid}/${img.image.ref.$link}/webp`, 54 54 alt: img.alt, 55 55 aspectRatio: img.aspectRatio, 56 56 })), 57 57 } satisfies SoSprkEmbedImages.View 58 58 } else if (post.embed?.$type === 'so.sprk.embed.video') { 59 - const did = await resolver.resolveDidToDidDoc(post.authorDid) 60 - const pdsDomain = did.pds.replace('https://', '') 61 59 embed = { 62 60 $type: 'so.sprk.embed.video#view', 63 61 cid: post.cid, 64 - playlist: `https://videocdn.sprk.so/${pdsDomain}/${post.authorDid}/${post.embed.video.ref.$link}`, 65 - thumbnail: `https://cdn.sprk.so/${post.authorDid}/${post.embed.video.ref.$link}/thumbnail`, 62 + playlist: `https://media.sprk.so/video/${post.authorDid}/${post.embed.video.ref.$link}`, 63 + thumbnail: `https://thumb.sprk.so/${post.authorDid}/${post.embed.video.ref.$link}/thumbnail`, 66 64 } satisfies SoSprkEmbedVideo.View 67 65 } 68 66