Skip empty app/game benchmark pages

This commit is contained in:
Sam Carlton 2021-03-04 21:29:01 -06:00
parent 9ee920d4f3
commit 5cded8a522

View file

@ -241,10 +241,15 @@ class BuildLists {
// Add benchmark endpoints for apps and games // Add benchmark endpoints for apps and games
if ( appType === 'app' || appType === 'game' ) { if ( appType === 'app' || appType === 'game' ) {
this.endpointSets.nuxt.add({ const payload = buildAppBenchmarkPayload( app, this.allVideoAppsList, this.lists.video )
route: `${getAppEndpoint(app)}/benchmarks`,
payload: buildAppBenchmarkPayload( app, this.allVideoAppsList, this.lists.video ) // Only add a benchmarks endpoint if it has any videos
}) if ( payload.allVideos.length > 0 ) {
this.endpointSets.nuxt.add({
route: `${getAppEndpoint(app)}/benchmarks`,
payload: buildAppBenchmarkPayload( app, this.allVideoAppsList, this.lists.video )
})
}
} }
// Add app or game endpoint // Add app or game endpoint