mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add related videos to api endpoints
This commit is contained in:
parent
275ab89f00
commit
744b7551a6
1 changed files with 10 additions and 1 deletions
|
|
@ -217,7 +217,16 @@ class BuildLists {
|
|||
const endpointPath = `./static/api${endpoint}.json`
|
||||
const endpointDirectory = dirname(endpointPath)
|
||||
|
||||
|
||||
// Add related videos
|
||||
if ( this.shouldHaveRelatedVideos( listEntry ) ) {
|
||||
listEntry.relatedVideos = videosRelatedToApp( listEntry, this.lists.video ).map(video => {
|
||||
// console.log('video', video)
|
||||
return {
|
||||
...video,
|
||||
endpoint: `${getAppEndpoint(listEntry)}/benchmarks#${video.id}`
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// console.log(`Saving endpoint "${endpoint}" to "${endpointPath}"`)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue