aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/VideosService.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2020-04-23 11:29:19 +0200
committerBond_009 <bond.009@outlook.com>2020-04-23 11:29:19 +0200
commit118f30059c11cf43d9780c8e0328423e35b44b76 (patch)
tree3dae865e35e3cd026e188706b5eec739cb33bf7b /MediaBrowser.Api/VideosService.cs
parent10afa4509db6fc7e3c2e7dd6ccc8997dfe3b10f9 (diff)
parent97e383d108a4adb7e57c13d67f1d36bd1b5ce7b5 (diff)
Merge branch 'master' into nullable4
Diffstat (limited to 'MediaBrowser.Api/VideosService.cs')
-rw-r--r--MediaBrowser.Api/VideosService.cs13
1 files changed, 2 insertions, 11 deletions
diff --git a/MediaBrowser.Api/VideosService.cs b/MediaBrowser.Api/VideosService.cs
index 46b6d5a94..b11fd48d3 100644
--- a/MediaBrowser.Api/VideosService.cs
+++ b/MediaBrowser.Api/VideosService.cs
@@ -139,17 +139,11 @@ namespace MediaBrowser.Api
.ToList();
var primaryVersion = videosWithVersions.FirstOrDefault();
-
if (primaryVersion == null)
{
primaryVersion = items.OrderBy(i =>
{
- if (i.Video3DFormat.HasValue)
- {
- return 1;
- }
-
- if (i.VideoType != Model.Entities.VideoType.VideoFile)
+ if (i.Video3DFormat.HasValue || i.VideoType != Model.Entities.VideoType.VideoFile)
{
return 1;
}
@@ -158,10 +152,7 @@ namespace MediaBrowser.Api
})
.ThenByDescending(i =>
{
- var stream = i.GetDefaultVideoStream();
-
- return stream == null || stream.Width == null ? 0 : stream.Width.Value;
-
+ return i.GetDefaultVideoStream()?.Width ?? 0;
}).First();
}