Skip to content

Commit

Permalink
remove text filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Jul 23, 2024
1 parent cc60b5b commit 61c5e6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/Settings/SettingsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export const SettingsTab = ({
toggle={false}
icon={'folder'}
name={`Set Room Media Source`}
description="Set a media source URL with files to replace the default examples. Supports S3 buckets, YouTube playlists, or a text list of URLs."
description="Set a media source URL with files to replace the default examples. Supports S3 buckets, YouTube playlists, or a link to a text list of URLs."
content={
<Input
value={mediaPath ?? ''}
Expand Down
12 changes: 2 additions & 10 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ export async function getMediaPathResults(
const response = await window.fetch(
serverPath + '/youtubePlaylist/' + playlistID,
);
const data = await response.json();
return data;
results = await response.json();
} else {
// Assume it's a text list of URLs
const response = await window.fetch(mediaPath);
Expand All @@ -283,14 +282,7 @@ 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()) &&
option.url,
);
return results;
return results.filter((res) => res.url);
}

export async function getStreamPathResults(
Expand Down

0 comments on commit 61c5e6c

Please sign in to comment.