Add by filename support to FileEntry.findFiles()

This commit is contained in:
Bryan Ashby 2022-09-15 12:37:48 -06:00
parent ad44495469
commit c105a2601a
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
1 changed files with 8 additions and 0 deletions

View File

@ -664,6 +664,14 @@ module.exports = class FileEntry {
}
}
if (_.isString(filter.fileName) && filter.fileName.length > 0) {
const caseSensitive = _.get(filter, 'filenameCaseSensitive', false);
const collate = caseSensitive ? '' : 'COLLATE NOCASE';
appendWhereClause(
`(f.file_name = "${sanitizeString(filter.fileName)}" ${collate})`
);
}
// handle e.g. 1998 -> "1998"
if (_.isNumber(filter.tags)) {
filter.tags = filter.tags.toString();