mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-10 23:00:57 +03:00
JSON blobs were accidentally inserted into DB, stringifying then parsing the video file object fixes this
This commit is contained in:
@@ -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']))
|
||||
|
||||
Reference in New Issue
Block a user