Fixed bug where playlistd could not be made

This commit is contained in:
Isaac Abadi
2021-01-09 17:25:46 -05:00
parent ed1375d40b
commit a93aa080b3
2 changed files with 3 additions and 3 deletions

View File

@@ -1954,7 +1954,7 @@ app.get('/api/getMp3s', optionalJwt, async function(req, res) {
// get user audio files/playlists
auth_api.passport.authenticate('jwt')
mp3s = auth_api.getUserVideos(req.user.uid, 'audio');
playlists = auth_api.getUserPlaylists(req.user.uid, 'audio');
playlists = auth_api.getUserPlaylists(req.user.uid);
}
mp3s = JSON.parse(JSON.stringify(mp3s));
@@ -1975,7 +1975,7 @@ app.get('/api/getMp4s', optionalJwt, async function(req, res) {
// get user videos/playlists
auth_api.passport.authenticate('jwt')
mp4s = auth_api.getUserVideos(req.user.uid, 'video');
playlists = auth_api.getUserPlaylists(req.user.uid, 'video');
playlists = auth_api.getUserPlaylists(req.user.uid);
}
mp4s = JSON.parse(JSON.stringify(mp4s));

View File

@@ -285,7 +285,7 @@ exports.adminExists = function() {
exports.getUserVideos = function(user_uid, type) {
const user = users_db.get('users').find({uid: user_uid}).value();
return type ? user['files'].filter(file => file.isAudio = (type === 'audio')) : user['files'];
return type ? user['files'].filter(file => file.isAudio === (type === 'audio')) : user['files'];
}
exports.getUserVideo = function(user_uid, file_uid, requireSharing = false) {