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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user