From 5cded8a52222c6a757303fee6e5f574231001779 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Thu, 4 Mar 2021 21:29:01 -0600 Subject: [PATCH] Skip empty app/game benchmark pages --- build-lists.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/build-lists.js b/build-lists.js index 160c3ef..ed9a390 100644 --- a/build-lists.js +++ b/build-lists.js @@ -241,10 +241,15 @@ class BuildLists { // Add benchmark endpoints for apps and games if ( appType === 'app' || appType === 'game' ) { - this.endpointSets.nuxt.add({ - route: `${getAppEndpoint(app)}/benchmarks`, - payload: buildAppBenchmarkPayload( app, this.allVideoAppsList, this.lists.video ) - }) + const 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