MCPcopy
hub / github.com/ThatGuySam/doesitarm / buildVideoPayload

Function buildVideoPayload

helpers/build-payload.js:7–26  ·  view source on GitHub ↗
( video, allVideoAppsListSet, videoListSet )

Source from the content-addressed store, hash-verified

5
6
7export function buildVideoPayload ( video, allVideoAppsListSet, videoListSet ) {
8 // const { appsRelatedToVideo, videosRelatedToVideo } = await import('~/helpers/related.js')
9 // const { default: videoList } = await import('~/static/video-list.json')
10
11 // Find the video for our current page
12 // const video = videoList.find(video => (video.slug === slug))
13
14 // Get featured apps
15 const featuredApps = appsRelatedToVideo( video, allVideoAppsListSet )
16
17 // Get related videos
18 const relatedVideos = videosRelatedToVideo( video, allVideoAppsListSet, videoListSet )
19
20 return {
21 video,
22 featuredApps,
23 // If no related video found just get the 12 newest ones
24 relatedVideos: (relatedVideos.length !== 0) ? relatedVideos.slice(0, 24) : Array.from(videoListSet).slice(0, 12)
25 }
26}
27
28
29export function buildAppBenchmarkPayload ( app, allVideoAppsListSet, videoListSet ) {

Callers 2

BuildListsClass · 0.90
buildMethod · 0.90

Calls 2

appsRelatedToVideoFunction · 0.90
videosRelatedToVideoFunction · 0.90

Tested by

no test coverage detected