diff options
| author | Nyanmisaka <nst799610810@gmail.com> | 2024-08-05 16:37:09 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-05 16:37:09 +0800 |
| commit | 2aa9cf4007c0217a8b4868f90f9295a395637277 (patch) | |
| tree | c47f46524118e9b5b1623cfe8a913001b4530865 /Jellyfin.Api/Controllers/LiveTvController.cs | |
| parent | 00088c295445fe2710cae468e1b09f98a32e40a5 (diff) | |
| parent | 7ea91dfcc4030892fff164d49969f6e85c8493fe (diff) | |
Merge branch 'master' into fix-hwa-video-rotation
Diffstat (limited to 'Jellyfin.Api/Controllers/LiveTvController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/LiveTvController.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Jellyfin.Api/Controllers/LiveTvController.cs b/Jellyfin.Api/Controllers/LiveTvController.cs index 2b26c01f8..6c3d01103 100644 --- a/Jellyfin.Api/Controllers/LiveTvController.cs +++ b/Jellyfin.Api/Controllers/LiveTvController.cs @@ -656,7 +656,7 @@ public class LiveTvController : BaseJellyfinApiController var query = new InternalItemsQuery(user) { - ChannelIds = body.ChannelIds, + ChannelIds = body.ChannelIds ?? [], HasAired = body.HasAired, IsAiring = body.IsAiring, EnableTotalRecordCount = body.EnableTotalRecordCount, @@ -666,31 +666,31 @@ public class LiveTvController : BaseJellyfinApiController MaxEndDate = body.MaxEndDate, StartIndex = body.StartIndex, Limit = body.Limit, - OrderBy = RequestHelpers.GetOrderBy(body.SortBy, body.SortOrder), + OrderBy = RequestHelpers.GetOrderBy(body.SortBy ?? [], body.SortOrder ?? []), IsNews = body.IsNews, IsMovie = body.IsMovie, IsSeries = body.IsSeries, IsKids = body.IsKids, IsSports = body.IsSports, SeriesTimerId = body.SeriesTimerId, - Genres = body.Genres, - GenreIds = body.GenreIds + Genres = body.Genres ?? [], + GenreIds = body.GenreIds ?? [] }; - if (!body.LibrarySeriesId.IsEmpty()) + if (!body.LibrarySeriesId.IsNullOrEmpty()) { query.IsSeries = true; - var series = _libraryManager.GetItemById<Series>(body.LibrarySeriesId); + var series = _libraryManager.GetItemById<Series>(body.LibrarySeriesId.Value); if (series is not null) { query.Name = series.Name; } } - var dtoOptions = new DtoOptions { Fields = body.Fields } + var dtoOptions = new DtoOptions { Fields = body.Fields ?? [] } .AddClientFields(User) - .AddAdditionalDtoOptions(body.EnableImages, body.EnableUserData, body.ImageTypeLimit, body.EnableImageTypes); + .AddAdditionalDtoOptions(body.EnableImages, body.EnableUserData, body.ImageTypeLimit, body.EnableImageTypes ?? []); return await _liveTvManager.GetPrograms(query, dtoOptions, CancellationToken.None).ConfigureAwait(false); } |
