Update packages/addon/src/utils.ts
Browse files
packages/addon/src/utils.ts
CHANGED
|
@@ -10,8 +10,8 @@ export function isBadVideo(file: FileData): boolean {
|
|
| 10 |
|
| 11 |
return (
|
| 12 |
// <= 5 minutes in duration
|
| 13 |
-
duration.match(/^\d+s/) ||
|
| 14 |
-
duration.match('^[0-5]m') ||
|
| 15 |
// password protected
|
| 16 |
file.passwd ||
|
| 17 |
// malicious
|
|
@@ -52,7 +52,7 @@ export function matchesTitle(fileTitle: string, query: string, strict: boolean):
|
|
| 52 |
|
| 53 |
// Loose matching: check if sanitized query exists within sanitized title
|
| 54 |
const re = new RegExp(`\\b${sanitizedQuery}\\b`, 'i');
|
| 55 |
-
const matchResult = re.test(sanitizedTitle);
|
| 56 |
console.log('Loose match result:', matchResult);
|
| 57 |
|
| 58 |
return matchResult;
|
|
|
|
| 10 |
|
| 11 |
return (
|
| 12 |
// <= 5 minutes in duration
|
| 13 |
+
!!duration.match(/^\d+s/) ||
|
| 14 |
+
!!duration.match('^[0-5]m') ||
|
| 15 |
// password protected
|
| 16 |
file.passwd ||
|
| 17 |
// malicious
|
|
|
|
| 52 |
|
| 53 |
// Loose matching: check if sanitized query exists within sanitized title
|
| 54 |
const re = new RegExp(`\\b${sanitizedQuery}\\b`, 'i');
|
| 55 |
+
const matchResult = re.test(sanitizedTitle); // `test()` returns a boolean
|
| 56 |
console.log('Loose match result:', matchResult);
|
| 57 |
|
| 58 |
return matchResult;
|