mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Add videoBenchmarksRelatedToApp helper
This commit is contained in:
parent
d9610b18f8
commit
6c3c4c1ca7
1 changed files with 12 additions and 0 deletions
|
|
@ -1,6 +1,8 @@
|
|||
// import { allVideoAppsListSet } from '~/helpers/get-list.js'
|
||||
// import videoList from '~/static/video-list.json'
|
||||
|
||||
import { getAppEndpoint, getAppType } from '~/helpers/app-derived.js'
|
||||
|
||||
function videoHasAppEndpoint ( video, appEndpoint ) {
|
||||
for (const appLink of video.appLinks) {
|
||||
if ( appLink.endpoint === appEndpoint ) {
|
||||
|
|
@ -70,3 +72,13 @@ export function videosRelatedToApp ( app, videoListSet ) {
|
|||
|
||||
return relatedVideos
|
||||
}
|
||||
|
||||
export function videoBenchmarksRelatedToApp ( app, videoListSet ) {
|
||||
return videosRelatedToApp( app, videoListSet ).map(video => {
|
||||
return {
|
||||
...video,
|
||||
endpoint: `${getAppEndpoint( app )}/benchmarks#${video.id}`
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue