Adds task to rebuild database

This commit is contained in:
Tzahi12345
2023-05-08 02:00:43 -04:00
parent 2a7b62272e
commit bad6080730
3 changed files with 95 additions and 4 deletions

View File

@@ -519,6 +519,17 @@ exports.convertFlatObjectToNestedObject = (obj) => {
return result;
}
exports.getDirectoriesInDirectory = async (basePath) => {
try {
const files = await fs.readdir(basePath, { withFileTypes: true });
return files
.filter((file) => file.isDirectory())
.map((file) => path.join(basePath, file.name));
} catch (err) {
return [];
}
}
// objects
function File(id, title, thumbnailURL, isAudio, duration, url, uploader, size, path, upload_date, description, view_count, height, abr) {