Fixed bug where audio files that had a stale webm extension in the metadata file path would fail to register

This commit is contained in:
Isaac Abadi
2020-12-26 15:51:13 -05:00
parent f74ce4b865
commit dbf08e1276
3 changed files with 15 additions and 14 deletions

View File

@@ -17,7 +17,7 @@ function initialize(input_db, input_users_db, input_logger) {
function registerFileDB(file_path, type, multiUserMode = null, sub = null, customPath = null, category = null) {
let db_path = null;
const file_id = file_path.substring(0, file_path.length-4);
const file_id = utils.removeFileExtension(file_path);
const file_object = generateFileObject(file_id, type, customPath || multiUserMode && multiUserMode.file_path, sub);
if (!file_object) {
logger.error(`Could not find associated JSON file for ${type} file ${file_id}`);