aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/PlayTo/PlayToController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Dlna/PlayTo/PlayToController.cs')
-rw-r--r--Emby.Dlna/PlayTo/PlayToController.cs16
1 files changed, 7 insertions, 9 deletions
diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.cs
index 23f2456ac2..e147cb977e 100644
--- a/Emby.Dlna/PlayTo/PlayToController.cs
+++ b/Emby.Dlna/PlayTo/PlayToController.cs
@@ -569,7 +569,7 @@ namespace Emby.Dlna.PlayTo
streamInfo.TargetVideoCodecTag,
streamInfo.IsTargetAVC);
- return list.Count == 0 ? null : list[0];
+ return list.FirstOrDefault();
}
return null;
@@ -883,7 +883,7 @@ namespace Emby.Dlna.PlayTo
private class StreamParams
{
- private MediaSourceInfo mediaSource;
+ private MediaSourceInfo _mediaSource;
private IMediaSourceManager _mediaSourceManager;
public Guid ItemId { get; set; }
@@ -908,24 +908,22 @@ namespace Emby.Dlna.PlayTo
public async Task<MediaSourceInfo> GetMediaSource(CancellationToken cancellationToken)
{
- if (mediaSource != null)
+ if (_mediaSource != null)
{
- return mediaSource;
+ return _mediaSource;
}
- var hasMediaSources = Item as IHasMediaSources;
-
- if (hasMediaSources == null)
+ if (Item is not IHasMediaSources)
{
return null;
}
if (_mediaSourceManager != null)
{
- mediaSource = await _mediaSourceManager.GetMediaSource(Item, MediaSourceId, LiveStreamId, false, cancellationToken).ConfigureAwait(false);
+ _mediaSource = await _mediaSourceManager.GetMediaSource(Item, MediaSourceId, LiveStreamId, false, cancellationToken).ConfigureAwait(false);
}
- return mediaSource;
+ return _mediaSource;
}
private static Guid GetItemId(string url)