1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Support searching for tv programs

This commit is contained in:
Joe Rogers 2022-05-21 12:26:35 +02:00
parent 1be3d30027
commit 46daea5238
No known key found for this signature in database
GPG key ID: 0074AD57B8FDBBB4

View file

@ -54,7 +54,6 @@ const LiveTVSearchResults: FunctionComponent<LiveTVSearchResultsProps> = ({ serv
IncludeArtists: false IncludeArtists: false
}); });
// FIXME: This query does not support Live TV filters
const fetchItems = (apiClient: ApiClient, params = {}) => apiClient?.getItems( const fetchItems = (apiClient: ApiClient, params = {}) => apiClient?.getItems(
apiClient?.getCurrentUserId(), apiClient?.getCurrentUserId(),
{ {
@ -79,57 +78,31 @@ const LiveTVSearchResults: FunctionComponent<LiveTVSearchResultsProps> = ({ serv
// Movies row // Movies row
fetchItems(apiClient, { fetchItems(apiClient, {
IncludeItemTypes: 'LiveTvProgram', IncludeItemTypes: 'LiveTvProgram',
IsMovie: true, IsMovie: true
IsSeries: false,
IsSports: false,
IsKids: false,
IsNews: false
}).then(result => setMovies(result.Items || [])); }).then(result => setMovies(result.Items || []));
// Episodes row // Episodes row
fetchItems(apiClient, { fetchItems(apiClient, {
IncludeItemTypes: 'LiveTvProgram', IncludeItemTypes: 'LiveTvProgram',
IsMovie: false, IsSeries: true
IsSeries: true,
IsSports: false,
IsKids: false,
IsNews: false
}).then(result => setEpisodes(result.Items || [])); }).then(result => setEpisodes(result.Items || []));
// Sports row // Sports row
fetchItems(apiClient, { fetchItems(apiClient, {
IncludeItemTypes: 'LiveTvProgram', IncludeItemTypes: 'LiveTvProgram',
IsMovie: false, IsSports: true
IsSeries: false,
IsSports: true,
IsKids: false,
IsNews: false
}).then(result => setSports(result.Items || [])); }).then(result => setSports(result.Items || []));
// Kids row // Kids row
fetchItems(apiClient, { fetchItems(apiClient, {
IncludeItemTypes: 'LiveTvProgram', IncludeItemTypes: 'LiveTvProgram',
IsMovie: false, IsKids: true
IsSeries: false,
IsSports: false,
IsKids: true,
IsNews: false
}).then(result => setKids(result.Items || [])); }).then(result => setKids(result.Items || []));
// News row // News row
fetchItems(apiClient, { fetchItems(apiClient, {
IncludeItemTypes: 'LiveTvProgram', IncludeItemTypes: 'LiveTvProgram',
IsMovie: false,
IsSeries: false,
IsSports: false,
IsKids: false,
IsNews: true IsNews: true
}).then(result => setNews(result.Items || [])); }).then(result => setNews(result.Items || []));
// Programs row // Programs row
fetchItems(apiClient, { fetchItems(apiClient, { IncludeItemTypes: 'LiveTvProgram' })
IncludeItemTypes: 'LiveTvProgram', .then(result => setPrograms(result.Items || []));
IsMovie: false,
IsSeries: false,
IsSports: false,
IsKids: false,
IsNews: false
}).then(result => setPrograms(result.Items || []));
// Channels row // Channels row
fetchItems(apiClient, { IncludeItemTypes: 'TvChannel' }) fetchItems(apiClient, { IncludeItemTypes: 'TvChannel' })
.then(result => setChannels(result.Items || [])); .then(result => setChannels(result.Items || []));