Skip to content

Commit

Permalink
Revert "whyboris#617"
Browse files Browse the repository at this point in the history
  • Loading branch information
kanwal019 authored Jan 22, 2021
1 parent 9c8b0d2 commit c39cdcf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
5 changes: 2 additions & 3 deletions node/main-support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,8 @@ export function createDotPlsFile(savePath: string, playlist: ImageElement[], sou
export function cleanUpFileName(original: string): string {
return original.split('.').slice(0, -1).join('.') // (1)
.split('_').join(' ') // (2)
.split('-').join(' ') // (3)
.split('.').join(' ') // (4)
.split(/\s+/).join(' ') // (5)
.split('.').join(' ') // (3)
.split(/\s+/).join(' ') // (4)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/app/pipes/file-search.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export class FileSearchPipe implements PipeTransform {
searchString += ' ' + item.partialPath.replace(/(\/)/, ' ');
}
}
const regex = new RegExp(`\\b${element.toLowerCase()}`, 'i');
if (regex.test(searchString.toLowerCase())) {

if (searchString.toLowerCase().indexOf(element.toLowerCase()) !== -1) {
matchFound++;
}
});
Expand Down
6 changes: 2 additions & 4 deletions src/app/pipes/magic-search.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ export class MagicSearchPipe implements PipeTransform {
return finalArray;
} else {
// console.log('magic search pipe working');
const regex = new RegExp(`\\b${searchString.toLowerCase()}`, 'i');
return finalArray.filter(item =>
regex.test(item.partialPath.toLowerCase())
|| (regex.test(item.fileName.toLowerCase())
|| regex.test(item.cleanName.toLowerCase()))
item.partialPath.toLowerCase().indexOf(searchString.toLowerCase()) !== -1
|| item.fileName.toLowerCase().indexOf(searchString.toLowerCase()) !== -1
);
}
}
Expand Down

0 comments on commit c39cdcf

Please sign in to comment.