diff --git a/backend/app.js b/backend/app.js index 50c1248..0cf5be0 100644 --- a/backend/app.js +++ b/backend/app.js @@ -1904,6 +1904,8 @@ app.get('/api/getMp3s', optionalJwt, function(req, res) { playlists = auth_api.getUserPlaylists(req.user.uid, 'audio'); } + mp3s = JSON.parse(JSON.stringify(mp3s)); + // add thumbnails if present mp3s.forEach(mp3 => { if (mp3['thumbnailPath'] && fs.existsSync(mp3['thumbnailPath'])) @@ -1929,6 +1931,8 @@ app.get('/api/getMp4s', optionalJwt, function(req, res) { playlists = auth_api.getUserPlaylists(req.user.uid, 'video'); } + mp4s = JSON.parse(JSON.stringify(mp4s)); + // add thumbnails if present mp4s.forEach(mp4 => { if (mp4['thumbnailPath'] && fs.existsSync(mp4['thumbnailPath'])) @@ -2019,6 +2023,8 @@ app.post('/api/getAllFiles', optionalJwt, function (req, res) { files = files.concat(sub.videos); } + files = JSON.parse(JSON.stringify(files)); + // add thumbnails if present files.forEach(file => { if (file['thumbnailPath'] && fs.existsSync(file['thumbnailPath']))