mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-18 14:51:29 +03:00
Fix missing keywords
This commit is contained in:
@@ -1946,7 +1946,7 @@ app.post('/api/getFile', optionalJwt, function (req, res) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post('/api/getAllFiles', optionalJwt, function (req, res) {
|
app.post('/api/getAllFiles', optionalJwt, async function (req, res) {
|
||||||
// these are returned
|
// these are returned
|
||||||
let files = [];
|
let files = [];
|
||||||
let playlists = [];
|
let playlists = [];
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ async function importUnregisteredFiles() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// run through check list and check each file to see if it's missing from the db
|
// run through check list and check each file to see if it's missing from the db
|
||||||
dirs_to_check.forEach(dir_to_check => {
|
for (const dir_to_check of dirs_to_check) {
|
||||||
// recursively get all files in dir's path
|
// recursively get all files in dir's path
|
||||||
const files = await utils.getDownloadedFilesByType(dir_to_check.basePath, dir_to_check.type);
|
const files = await utils.getDownloadedFilesByType(dir_to_check.basePath, dir_to_check.type);
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ async function importUnregisteredFiles() {
|
|||||||
logger.verbose(`Added discovered file to the database: ${file.id}`);
|
logger.verbose(`Added discovered file to the database: ${file.id}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,25 +161,23 @@ function deleteJSONFile(name, type, customPath = null) {
|
|||||||
|
|
||||||
async function recFindByExt(base,ext,files,result)
|
async function recFindByExt(base,ext,files,result)
|
||||||
{
|
{
|
||||||
files = files || fs.readdirSync(base)
|
files = files || (await fs.readdir(base))
|
||||||
result = result || []
|
result = result || []
|
||||||
|
|
||||||
files.forEach(
|
for (const file in files) {
|
||||||
function (file) {
|
var newbase = path.join(base,file)
|
||||||
var newbase = path.join(base,file)
|
if ( (await fs.stat(newbase)).isDirectory() )
|
||||||
if ( fs.statSync(newbase).isDirectory() )
|
{
|
||||||
|
result = await recFindByExt(newbase,ext,await fs.readdir(newbase),result)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( file.substr(-1*(ext.length+1)) == '.' + ext )
|
||||||
{
|
{
|
||||||
result = await recFindByExt(newbase,ext,fs.readdirSync(newbase),result)
|
result.push(newbase)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( file.substr(-1*(ext.length+1)) == '.' + ext )
|
|
||||||
{
|
|
||||||
result.push(newbase)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user