mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Limit related videos to 20
This commit is contained in:
parent
234cec0ce4
commit
b8f996ef17
1 changed files with 5 additions and 3 deletions
|
|
@ -50,14 +50,16 @@ export function videosRelatedToApp ( app, videoListSet ) {
|
|||
|
||||
// console.log('videoListSet', videoListSet)
|
||||
|
||||
const relatedVideos = {}
|
||||
const relatedVideos = []
|
||||
|
||||
// Find other videos that also feature this video's app
|
||||
for (const video of videoListSet) {
|
||||
if (!video.apps.includes(app.slug)) continue
|
||||
|
||||
relatedVideos[video.id] = video
|
||||
relatedVideos.push( video )
|
||||
|
||||
if ( relatedVideos.length > 20 ) break
|
||||
}
|
||||
|
||||
return Object.values(relatedVideos)
|
||||
return relatedVideos
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue