mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-17 01:31:28 +03:00
Blobs are now only included in getAllFiles() if the config option for including thumbnail is set to true
This commit is contained in:
@@ -1936,11 +1936,13 @@ app.get('/api/getMp3s', optionalJwt, function(req, res) {
|
|||||||
|
|
||||||
mp3s = JSON.parse(JSON.stringify(mp3s));
|
mp3s = JSON.parse(JSON.stringify(mp3s));
|
||||||
|
|
||||||
// add thumbnails if present
|
if (config_api.getConfigItem('ytdl_include_thumbnail')) {
|
||||||
mp3s.forEach(mp3 => {
|
// add thumbnails if present
|
||||||
if (mp3['thumbnailPath'] && fs.existsSync(mp3['thumbnailPath']))
|
mp3s.forEach(mp3 => {
|
||||||
mp3['thumbnailBlob'] = fs.readFileSync(mp3['thumbnailPath']);
|
if (mp3['thumbnailPath'] && fs.existsSync(mp3['thumbnailPath']))
|
||||||
});
|
mp3['thumbnailBlob'] = fs.readFileSync(mp3['thumbnailPath']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
res.send({
|
res.send({
|
||||||
mp3s: mp3s,
|
mp3s: mp3s,
|
||||||
@@ -1963,11 +1965,13 @@ app.get('/api/getMp4s', optionalJwt, function(req, res) {
|
|||||||
|
|
||||||
mp4s = JSON.parse(JSON.stringify(mp4s));
|
mp4s = JSON.parse(JSON.stringify(mp4s));
|
||||||
|
|
||||||
// add thumbnails if present
|
if (config_api.getConfigItem('ytdl_include_thumbnail')) {
|
||||||
mp4s.forEach(mp4 => {
|
// add thumbnails if present
|
||||||
if (mp4['thumbnailPath'] && fs.existsSync(mp4['thumbnailPath']))
|
mp4s.forEach(mp4 => {
|
||||||
mp4['thumbnailBlob'] = fs.readFileSync(mp4['thumbnailPath']);
|
if (mp4['thumbnailPath'] && fs.existsSync(mp4['thumbnailPath']))
|
||||||
});
|
mp4['thumbnailBlob'] = fs.readFileSync(mp4['thumbnailPath']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
res.send({
|
res.send({
|
||||||
mp4s: mp4s,
|
mp4s: mp4s,
|
||||||
@@ -2055,12 +2059,14 @@ app.post('/api/getAllFiles', optionalJwt, function (req, res) {
|
|||||||
|
|
||||||
files = JSON.parse(JSON.stringify(files));
|
files = JSON.parse(JSON.stringify(files));
|
||||||
|
|
||||||
// add thumbnails if present
|
if (config_api.getConfigItem('ytdl_include_thumbnail')) {
|
||||||
files.forEach(file => {
|
// add thumbnails if present
|
||||||
if (file['thumbnailPath'] && fs.existsSync(file['thumbnailPath']))
|
files.forEach(file => {
|
||||||
file['thumbnailBlob'] = fs.readFileSync(file['thumbnailPath']);
|
if (file['thumbnailPath'] && fs.existsSync(file['thumbnailPath']))
|
||||||
});
|
file['thumbnailBlob'] = fs.readFileSync(file['thumbnailPath']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
res.send({
|
res.send({
|
||||||
files: files,
|
files: files,
|
||||||
playlists: playlists
|
playlists: playlists
|
||||||
@@ -2166,7 +2172,8 @@ app.post('/api/createCategory', optionalJwt, async (req, res) => {
|
|||||||
const new_category = {
|
const new_category = {
|
||||||
name: name,
|
name: name,
|
||||||
uid: uuid(),
|
uid: uuid(),
|
||||||
rules: []
|
rules: [],
|
||||||
|
custom_putput: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
db.get('categories').push(new_category).write();
|
db.get('categories').push(new_category).write();
|
||||||
|
|||||||
Reference in New Issue
Block a user