Add isVideo function

This commit is contained in:
Sam Carlton 2021-03-02 21:53:43 -06:00
parent 361505e6cd
commit ef4f3d570e

View file

@ -1,7 +1,18 @@
// App Data that is derived from other app data
export function isVideo ( app ) {
return app.hasOwnProperty('thumbnail') && app.hasOwnProperty('timestamps')
}
export function getAppType ( app ) {
// Videos don't have a category
// so we check for videos here
if ( isVideo( app ) ) {
return 'video'
}
if(app.category !== Object(app.category)) {
console.warn('app has no categories', app)