From ecf507db337795a2b3e48c6e850a67a82aa9bf6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikha=C3=ABl=20Regni?= Date: Wed, 19 Aug 2020 08:27:28 +0200 Subject: [PATCH] Added video range column #1328 --- .../Extensions/BaseItemDtoExtension.cs | 3 ++- .../Models/Entities/Helpers/VideoStream.cs | 1 + EmbyStat.Common/Models/Net/BaseMediaStream.cs | 2 ++ .../Movie/MovieColumnViewModel.cs | 1 + EmbyStat.Services/Models/DataGrid/MovieColumn.cs | 7 ++++++- EmbyStat.Services/MovieService.cs | 3 ++- .../src/pages/movies/MoviesList/index.tsx | 16 ++++++++++------ 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/EmbyStat.Common/Extensions/BaseItemDtoExtension.cs b/EmbyStat.Common/Extensions/BaseItemDtoExtension.cs index b557bbc3b..a9b9317f6 100644 --- a/EmbyStat.Common/Extensions/BaseItemDtoExtension.cs +++ b/EmbyStat.Common/Extensions/BaseItemDtoExtension.cs @@ -52,7 +52,8 @@ public static T MapStreams(this BaseItemDto dto, T video) where T : Video Width = y.Width, BitDepth = y.BitDepth, Codec = y.Codec, - IsDefault = y.IsDefault + IsDefault = y.IsDefault, + VideoRange = y.VideoRange }).ToList(); } else diff --git a/EmbyStat.Common/Models/Entities/Helpers/VideoStream.cs b/EmbyStat.Common/Models/Entities/Helpers/VideoStream.cs index 0a1988851..5980c135b 100644 --- a/EmbyStat.Common/Models/Entities/Helpers/VideoStream.cs +++ b/EmbyStat.Common/Models/Entities/Helpers/VideoStream.cs @@ -16,5 +16,6 @@ public class VideoStream public int? BitDepth { get; set; } public string Codec { get; set; } public bool IsDefault { get; set; } + public string VideoRange { get; set; } } } \ No newline at end of file diff --git a/EmbyStat.Common/Models/Net/BaseMediaStream.cs b/EmbyStat.Common/Models/Net/BaseMediaStream.cs index 413b33f2e..9cdeb65ae 100644 --- a/EmbyStat.Common/Models/Net/BaseMediaStream.cs +++ b/EmbyStat.Common/Models/Net/BaseMediaStream.cs @@ -5,6 +5,7 @@ namespace EmbyStat.Common.Models.Net public class BaseMediaStream { public int? BitRate { get; set; } + public int? BitDepth { get; set; } public string ChannelLayout { get; set; } public int? Channels { get; set; } public string Codec { get; set; } @@ -12,6 +13,7 @@ public class BaseMediaStream public int? SampleRate { get; set; } public string DisplayTitle { get; set; } public bool IsDefault { get; set; } + public string VideoRange { get; set; } public string AspectRatio { get; set; } public float? AverageFrameRate { get; set; } public int? Height { get; set; } diff --git a/EmbyStat.Controllers/Movie/MovieColumnViewModel.cs b/EmbyStat.Controllers/Movie/MovieColumnViewModel.cs index 56e9f6e5c..8c4f9da20 100644 --- a/EmbyStat.Controllers/Movie/MovieColumnViewModel.cs +++ b/EmbyStat.Controllers/Movie/MovieColumnViewModel.cs @@ -29,5 +29,6 @@ public class MovieColumnViewModel public int? Width { get; set; } public string Codec { get; set; } public int? BitDepth { get; set; } + public string VideoRange { get; set; } } } diff --git a/EmbyStat.Services/Models/DataGrid/MovieColumn.cs b/EmbyStat.Services/Models/DataGrid/MovieColumn.cs index 41ace06d6..f00339cc5 100644 --- a/EmbyStat.Services/Models/DataGrid/MovieColumn.cs +++ b/EmbyStat.Services/Models/DataGrid/MovieColumn.cs @@ -23,7 +23,12 @@ public class MovieColumn public string SortName { get; set; } public string Path { get; set; } public DateTimeOffset? PremiereDate { get; set; } - public string[] Resolutions { get; set; } public double SizeInMb { get; set; } + public double BitRate { get; set; } + public int? Height { get; set; } + public int? Width { get; set; } + public string Codec { get; set; } + public int? BitDepth { get; set; } + public string VideoRange { get; set; } } } diff --git a/EmbyStat.Services/MovieService.cs b/EmbyStat.Services/MovieService.cs index 9d0c29be0..6a3d36c92 100644 --- a/EmbyStat.Services/MovieService.cs +++ b/EmbyStat.Services/MovieService.cs @@ -124,7 +124,8 @@ public Page GetMoviePage(int skip, int take, string sort, Filter[] SizeInMb = x.MediaSources.FirstOrDefault()?.SizeInMb ?? 0, BitRate = Math.Round((x.VideoStreams.FirstOrDefault()?.BitRate ?? 0d) / 1048576, 2), Codec = x.VideoStreams.FirstOrDefault()?.Codec, - BitDepth = x.VideoStreams.FirstOrDefault()?.BitDepth + BitDepth = x.VideoStreams.FirstOrDefault()?.BitDepth, + VideoRange = x.VideoStreams.FirstOrDefault()?.VideoRange }); var page = new Page { Data = list }; diff --git a/EmbyStat.Web/ClientApp/src/pages/movies/MoviesList/index.tsx b/EmbyStat.Web/ClientApp/src/pages/movies/MoviesList/index.tsx index 1f7d50c16..b6dbe9980 100644 --- a/EmbyStat.Web/ClientApp/src/pages/movies/MoviesList/index.tsx +++ b/EmbyStat.Web/ClientApp/src/pages/movies/MoviesList/index.tsx @@ -214,19 +214,18 @@ const MovieList = (props: Props) => { defaultSortIndex={0} defaultSortOrder="asc" /> + - { dataField="codec" allowSorting={false} /> +