From 770af94ec2dc92042880da36e38b61fdf98f21ed Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Thu, 9 Jun 2022 15:55:53 -0500 Subject: [PATCH] Add getRelatedVideos helper --- helpers/related.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/helpers/related.js b/helpers/related.js index 73bc7dd..f157ef2 100644 --- a/helpers/related.js +++ b/helpers/related.js @@ -82,3 +82,14 @@ export function videoBenchmarksRelatedToApp ( app, videoListSet ) { }) } + +export function getRelatedVideos ( { listing, videoListSet, appListSet } = {} ) { + const listingType = getAppType( listing ) + + if ( listingType === 'video' ) { + return videosRelatedToVideo( listing, appListSet, videoListSet ) + } + + return videoBenchmarksRelatedToApp( listing, videoListSet ) +} +