From ef4f3d570e59fa66d0e7579fbf6b4745886606a2 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Tue, 2 Mar 2021 21:53:43 -0600 Subject: [PATCH] Add isVideo function --- helpers/app-derived.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/helpers/app-derived.js b/helpers/app-derived.js index a7c4c9c..8ed7ec0 100644 --- a/helpers/app-derived.js +++ b/helpers/app-derived.js @@ -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)