diff options
| author | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-26 11:44:42 -0400 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-26 11:44:42 -0400 |
| commit | 93649ad77b1e6b005a9b7a33d4c82bbce6189ecc (patch) | |
| tree | 225dc540a6166ed8ae13a4159cb1811a6c600f3c /MediaBrowser.Api/VideosService.cs | |
| parent | 00a0e013c695a3741218985afadd31265a6ddb40 (diff) | |
| parent | f81833693d0cae476d923f704451bb794a78da8a (diff) | |
Merge remote-tracking branch 'upstream/master' into simplify-https-config
Diffstat (limited to 'MediaBrowser.Api/VideosService.cs')
| -rw-r--r-- | MediaBrowser.Api/VideosService.cs | 13 |
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(); } |
