From 4a9550e58486873a487684994a68109830501a69 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 14 Sep 2017 15:23:34 -0400 Subject: [PATCH] update live tv images --- .../Data/SqliteItemRepository.cs | 66 ------------------- .../LiveTv/LiveTvAudioRecording.cs | 8 ++- .../LiveTv/LiveTvProgram.cs | 15 +++-- .../LiveTv/LiveTvVideoRecording.cs | 8 ++- SharedVersion.cs | 2 +- 5 files changed, 21 insertions(+), 78 deletions(-) diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index ea3845f0c..b895f68aa 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -4716,72 +4716,6 @@ namespace Emby.Server.Implementations.Data public void UpdateInheritedValues(CancellationToken cancellationToken) { - UpdateInheritedTags(cancellationToken); - } - - private void UpdateInheritedTags(CancellationToken cancellationToken) - { - var newValues = new List>(); - - var commandText = @"select guid, -(select group_concat(Value, '|') from ItemValues where (ItemValues.ItemId = Outer.Guid OR ItemValues.ItemId in ((Select AncestorId from AncestorIds where AncestorIds.ItemId=Outer.guid))) and ItemValues.Type = 4) NewInheritedTags, -(select group_concat(Value, '|') from ItemValues where ItemValues.ItemId = Outer.Guid and ItemValues.Type = 6) CurrentInheritedTags -from typedbaseitems as Outer -where (NewInheritedTags <> CurrentInheritedTags or (NewInheritedTags is null) <> (CurrentInheritedTags is null)) -limit 100"; - - using (WriteLock.Write()) - { - using (var connection = CreateConnection()) - { - connection.RunInTransaction(db => - { - foreach (var row in connection.Query(commandText)) - { - var id = row.GetGuid(0); - string value = row.IsDBNull(1) ? null : row.GetString(1); - - var valuesArray = string.IsNullOrWhiteSpace(value) ? new string[] { } : value.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries); - - newValues.Add(new Tuple(id, valuesArray)); - } - - Logger.Debug("UpdateInheritedTags - {0} rows", newValues.Count); - if (newValues.Count == 0) - { - return; - } - - using (var insertStatement = PrepareStatement(connection, "insert into ItemValues (ItemId, Type, Value, CleanValue) values (@ItemId, 6, @Value, @CleanValue)")) - { - using (var deleteStatement = PrepareStatement(connection, "delete from ItemValues where ItemId=@ItemId and Type=6")) - { - foreach (var item in newValues) - { - var guidBlob = item.Item1.ToGuidBlob(); - - deleteStatement.Reset(); - deleteStatement.TryBind("@ItemId", guidBlob); - deleteStatement.MoveNext(); - - foreach (var itemValue in item.Item2) - { - insertStatement.Reset(); - - insertStatement.TryBind("@ItemId", guidBlob); - insertStatement.TryBind("@Value", itemValue); - - insertStatement.TryBind("@CleanValue", GetCleanValue(itemValue)); - - insertStatement.MoveNext(); - } - } - } - } - - }, TransactionMode); - } - } } private static Dictionary GetTypeMapDictionary() diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs index c29d73253..ac73f240a 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs @@ -89,12 +89,14 @@ namespace MediaBrowser.Controller.LiveTv } } + private static string EmbyServiceName = "Emby"; public override double? GetDefaultPrimaryImageAspectRatio() { - if (IsMovie) + var serviceName = ServiceName; + if (!IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(serviceName)) { - double value = 2; - value /= 3; + double value = 16; + value /= 9; return value; } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 896615ad9..5c83f6412 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -53,13 +53,18 @@ namespace MediaBrowser.Controller.LiveTv var serviceName = ServiceName; if (!IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(serviceName)) { - return null; + double value = 16; + value /= 9; + + return value; } + else + { + double value = 2; + value /= 3; - double value = 2; - value /= 3; - - return value; + return value; + } } [IgnoreDataMember] diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs index 950949f37..9a744b8f8 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -98,12 +98,14 @@ namespace MediaBrowser.Controller.LiveTv return false; } + private static string EmbyServiceName = "Emby"; public override double? GetDefaultPrimaryImageAspectRatio() { - if (IsMovie) + var serviceName = ServiceName; + if (!IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(serviceName)) { - double value = 2; - value /= 3; + double value = 16; + value /= 9; return value; } diff --git a/SharedVersion.cs b/SharedVersion.cs index 8d5353ca5..82314df11 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.30.19")] +[assembly: AssemblyVersion("3.2.30.20")]