Skip to content

Commit

Permalink
fix filter
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Jul 14, 2024
1 parent 54d82f9 commit cc60b5b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,13 @@ export async function getMediaPathResults(
.split('\n')
.map((line) => ({ url: line, name: line, duration: 0, type: 'file' }));
}
results = results
.filter(
(option: SearchResult) =>
// Exclude subtitles
!option.url.endsWith('.srt') &&
option.name.toLowerCase().includes(query.toLowerCase()),
)
.filter(Boolean);
results = results.filter(
(option: SearchResult) =>
// Exclude subtitles
!option.url.endsWith('.srt') &&
option.name.toLowerCase().includes(query.toLowerCase()) &&
option.url,
);
return results;
}

Expand Down

0 comments on commit cc60b5b

Please sign in to comment.