aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/TV
diff options
context:
space:
mode:
authorBaronGreenback <jimcartlidge@yahoo.co.uk>2021-05-05 12:37:36 +0100
committerGitHub <noreply@github.com>2021-05-05 13:37:36 +0200
commitf2c10471bf00263adc6411b38db60ba931d0ec15 (patch)
tree7f63cfc7a6def01bc758e24cf18217d1b8dcc883 /Emby.Server.Implementations/TV
parent18d799b22a2bd54bb99c5a99edcbd2edfa6887c4 (diff)
Code Clean up: Use Pattern Matching (#5838)
Co-authored-by: Cody Robibero <cody@robibe.ro> Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
Diffstat (limited to 'Emby.Server.Implementations/TV')
-rw-r--r--Emby.Server.Implementations/TV/TVSeriesManager.cs8
1 files changed, 2 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.cs
index d3f6fa34d..829df64bf 100644
--- a/Emby.Server.Implementations/TV/TVSeriesManager.cs
+++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs
@@ -43,9 +43,7 @@ namespace Emby.Server.Implementations.TV
string presentationUniqueKey = null;
if (!string.IsNullOrEmpty(request.SeriesId))
{
- var series = _libraryManager.GetItemById(request.SeriesId) as Series;
-
- if (series != null)
+ if (_libraryManager.GetItemById(request.SeriesId) is Series series)
{
presentationUniqueKey = GetUniqueSeriesKey(series);
}
@@ -95,9 +93,7 @@ namespace Emby.Server.Implementations.TV
int? limit = null;
if (!string.IsNullOrEmpty(request.SeriesId))
{
- var series = _libraryManager.GetItemById(request.SeriesId) as Series;
-
- if (series != null)
+ if (_libraryManager.GetItemById(request.SeriesId) is Series series)
{
presentationUniqueKey = GetUniqueSeriesKey(series);
limit = 1;