Write all apps summary to json

This commit is contained in:
Sam Carlton 2022-05-24 16:51:20 -05:00
parent b37e8bc8e7
commit c5a3bfbbf2

View file

@ -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()