aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/VideosService.cs
diff options
context:
space:
mode:
authorMark Monteiro <marknr.monteiro@protonmail.com>2020-04-13 17:06:24 -0400
committerMark Monteiro <marknr.monteiro@protonmail.com>2020-04-13 17:06:24 -0400
commit9728aa8b0abc7785f8c9f3d62c2adff1920cfab9 (patch)
tree111975663193ef2dfab67380e6d5a2f4f9d554f6 /MediaBrowser.Api/VideosService.cs
parent17e8813378c2fe1a83d1eddb829dae68f8c71bfe (diff)
parent9a0a4575adbba04b6b7f3294e70175a98b864a90 (diff)
Merge branch 'master' into register-services-correctly
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();
}