aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/VideosService.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2020-05-02 00:54:04 +0200
committerBond_009 <bond.009@outlook.com>2020-05-02 00:54:04 +0200
commit15634a1913e8c1ad4e921364f30055794644d0bd (patch)
treef0dfb3502728e4786de32c0cb4eaabd06f8e2d87 /MediaBrowser.Api/VideosService.cs
parent407f54e7764a6bfd8e4ccc0df897fac7e8c658b4 (diff)
parent62e251663fce8216cea529f85382299ac2f39fbc (diff)
Merge branch 'master' into websocket
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();
}