From c5a3bfbbf26a6b29a3bef21a543ef1a728869840 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Tue, 24 May 2022 16:51:20 -0500 Subject: [PATCH] Write all apps summary to json --- build-lists.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build-lists.js b/build-lists.js index 3aa4c9a..441af39 100644 --- a/build-lists.js +++ b/build-lists.js @@ -13,6 +13,7 @@ import buildHomebrewList from '~/helpers/build-homebrew-list.js' import buildVideoList from '~/helpers/build-video-list.js' import buildDeviceList from '~/helpers/build-device-list.js' import { deviceSupportsApp } from '~/helpers/devices.js' +import getListSummaryNumbers from '~/helpers/get-list-summary-numbers.js' import { videosRelatedToApp } from '~/helpers/related.js' import { buildVideoPayload, buildAppBenchmarkPayload } from '~/helpers/build-payload.js' @@ -536,6 +537,18 @@ class BuildLists { return } + async saveAllAppsSummary () { + const summaryNumbers = getListSummaryNumbers( [ + ...this.getListArray('app'), + ...this.getListArray('game'), + ...this.getListArray('homebrew'), + ] ) + + await this.saveToJson( summaryNumbers, `${apiDirectory}/all-apps-summary.json` ) + + return summaryNumbers + } + async build () { // Pull in and layer data from all sources @@ -544,6 +557,8 @@ class BuildLists { // Save the data to respective files as lists await this.saveAppLists() + await this.saveAllAppsSummary() + // Save kind lists await this.saveKinds()