mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-21 19:23:20 +03:00
JSON metadata files are no longer kept if the associated setting is not enabled
This commit is contained in:
@@ -26,10 +26,7 @@ function registerFileDB(file_path, type, multiUserMode = null, sub = null) {
|
||||
|
||||
utils.fixVideoMetadataPerms(file_id, type, multiUserMode && multiUserMode.file_path);
|
||||
|
||||
// add additional info
|
||||
file_object['uid'] = uuid();
|
||||
file_object['registered'] = Date.now();
|
||||
file_object['path'] = path.format(path.parse(file_object['path']));
|
||||
// add thumbnail path
|
||||
file_object['thumbnailPath'] = utils.getDownloadedThumbnail(file_id, type, multiUserMode && multiUserMode.file_path);
|
||||
|
||||
if (!sub) {
|
||||
@@ -48,7 +45,13 @@ function registerFileDB(file_path, type, multiUserMode = null, sub = null) {
|
||||
}
|
||||
}
|
||||
|
||||
const file_uid = registerFileDBManual(db_path, file_object)
|
||||
const file_uid = registerFileDBManual(db_path, file_object);
|
||||
|
||||
// remove metadata JSON if needed
|
||||
if (!config_api.getConfigItem('ytdl_include_metadata')) {
|
||||
utils.deleteJSONFile(file_id, type, multiUserMode && multiUserMode.file_path)
|
||||
}
|
||||
|
||||
return file_uid;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user