diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-04-11 19:30:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-11 19:30:23 +0200 |
| commit | 14674d446954b24c9754431f550c590083e7a94c (patch) | |
| tree | fc766140d5d96d63a512a1b962fd86e0ba91d161 /MediaBrowser.Api/VideosService.cs | |
| parent | 299541f1b26136ef89741f28c7949cda4e5e485f (diff) | |
| parent | 555651aae23e788b10760d58840114d8a010da90 (diff) | |
Merge pull request #2772 from barronpm/codecleanup
MediaBrowser.Api code cleanup
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(); } |
