diff options
| author | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-13 17:06:24 -0400 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-13 17:06:24 -0400 |
| commit | 9728aa8b0abc7785f8c9f3d62c2adff1920cfab9 (patch) | |
| tree | 111975663193ef2dfab67380e6d5a2f4f9d554f6 /MediaBrowser.Api/TvShowsService.cs | |
| parent | 17e8813378c2fe1a83d1eddb829dae68f8c71bfe (diff) | |
| parent | 9a0a4575adbba04b6b7f3294e70175a98b864a90 (diff) | |
Merge branch 'master' into register-services-correctly
Diffstat (limited to 'MediaBrowser.Api/TvShowsService.cs')
| -rw-r--r-- | MediaBrowser.Api/TvShowsService.cs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/MediaBrowser.Api/TvShowsService.cs b/MediaBrowser.Api/TvShowsService.cs index 334d1db51..cd8e8dfbe 100644 --- a/MediaBrowser.Api/TvShowsService.cs +++ b/MediaBrowser.Api/TvShowsService.cs @@ -424,9 +424,7 @@ namespace MediaBrowser.Api if (!string.IsNullOrWhiteSpace(request.SeasonId)) { - var season = _libraryManager.GetItemById(new Guid(request.SeasonId)) as Season; - - if (season == null) + if (!(_libraryManager.GetItemById(new Guid(request.SeasonId)) is Season season)) { throw new ResourceNotFoundException("No season exists with Id " + request.SeasonId); } @@ -444,14 +442,7 @@ namespace MediaBrowser.Api var season = series.GetSeasons(user, dtoOptions).FirstOrDefault(i => i.IndexNumber == request.Season.Value); - if (season == null) - { - episodes = new List<BaseItem>(); - } - else - { - episodes = ((Season)season).GetEpisodes(user, dtoOptions); - } + episodes = season == null ? new List<BaseItem>() : ((Season)season).GetEpisodes(user, dtoOptions); } else { |
