From 6eb6ffa5e409b817bae494c9486c6cc15877c301 Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Tue, 22 Dec 2020 01:25:12 -0500 Subject: [PATCH] Get user videos now accepts an optional type parameter --- backend/authentication/auth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/authentication/auth.js b/backend/authentication/auth.js index 3c77edd..ce8f100 100644 --- a/backend/authentication/auth.js +++ b/backend/authentication/auth.js @@ -281,9 +281,9 @@ exports.adminExists = function() { // video stuff -exports.getUserVideos = function(user_uid) { +exports.getUserVideos = function(user_uid, type) { const user = users_db.get('users').find({uid: user_uid}).value(); - return user['files']; + return type ? user['files'].filter(file => file.isAudio = (type === 'audio')) : user['files']; } exports.getUserVideo = function(user_uid, file_uid, requireSharing = false) {