mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Include device support on listings
This commit is contained in:
parent
e054b29d64
commit
b9d05f5fa0
1 changed files with 26 additions and 6 deletions
|
|
@ -9,6 +9,7 @@ import buildGamesList from './helpers/build-game-list.js'
|
||||||
import buildHomebrewList from './helpers/build-homebrew-list.js'
|
import buildHomebrewList from './helpers/build-homebrew-list.js'
|
||||||
import buildVideoList from './helpers/build-video-list.js'
|
import buildVideoList from './helpers/build-video-list.js'
|
||||||
import buildDeviceList from './helpers/build-device-list.js'
|
import buildDeviceList from './helpers/build-device-list.js'
|
||||||
|
import { deviceSupportsApp } from './helpers/devices.js'
|
||||||
|
|
||||||
import { videosRelatedToApp } from './helpers/related.js'
|
import { videosRelatedToApp } from './helpers/related.js'
|
||||||
import { buildVideoPayload, buildAppBenchmarkPayload } from './helpers/build-payload.js'
|
import { buildVideoPayload, buildAppBenchmarkPayload } from './helpers/build-payload.js'
|
||||||
|
|
@ -135,6 +136,12 @@ class BuildLists {
|
||||||
return appType === 'app' || appType === 'formula'
|
return appType === 'app' || appType === 'formula'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shouldHaveDeviceSupport ( app ) {
|
||||||
|
const appType = getAppType( app )
|
||||||
|
|
||||||
|
return appType === 'app' || appType === 'formula' || appType === 'game'
|
||||||
|
}
|
||||||
|
|
||||||
getAllVideoAppsList = () => {
|
getAllVideoAppsList = () => {
|
||||||
return new Set([
|
return new Set([
|
||||||
...this.lists.app,
|
...this.lists.app,
|
||||||
|
|
@ -287,6 +294,19 @@ class BuildLists {
|
||||||
listEntry.bundles = await this.getAppBundles( listEntry )
|
listEntry.bundles = await this.getAppBundles( listEntry )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Add device support
|
||||||
|
if ( this.shouldHaveDeviceSupport( listEntry ) ) {
|
||||||
|
listEntry.deviceSupport = this.lists[ 'device' ].map( device => {
|
||||||
|
const supportsApp = deviceSupportsApp( device, listEntry )
|
||||||
|
return {
|
||||||
|
...device,
|
||||||
|
emoji: supportsApp ? '✅' : '🚫',
|
||||||
|
ariaLabel: `${ listEntry.name } has ${ supportsApp ? '' : 'not' } been reported to work on ${ device.name }`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// console.log(`Saving endpoint "${endpoint}" to "${endpointPath}"`)
|
// console.log(`Saving endpoint "${endpoint}" to "${endpointPath}"`)
|
||||||
|
|
||||||
// Ensure the directory exists
|
// Ensure the directory exists
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue