From d2b86edf0532af617c233c01ac0973c44448c447 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 15 Aug 2017 23:40:36 -0400 Subject: [PATCH 1/2] update hdhr channel ids --- Emby.Drawing.Skia/SkiaEncoder.cs | 19 ++--- .../ApplicationHost.cs | 81 +------------------ .../Data/SqliteItemRepository.cs | 38 +++------ .../TunerHosts/HdHomerun/HdHomerunHost.cs | 5 +- .../Session/SessionManager.cs | 1 - MediaBrowser.Api/LiveTv/LiveTvService.cs | 2 + MediaBrowser.Controller/Entities/BaseItem.cs | 1 + MediaBrowser.Controller/Entities/Video.cs | 6 -- MediaBrowser.Model/LiveTv/LiveTvOptions.cs | 1 + MediaBrowser.Model/Querying/ItemFields.cs | 5 -- .../Manager/ProviderUtils.cs | 17 ---- 11 files changed, 31 insertions(+), 145 deletions(-) diff --git a/Emby.Drawing.Skia/SkiaEncoder.cs b/Emby.Drawing.Skia/SkiaEncoder.cs index 071c40c29..77ab1919a 100644 --- a/Emby.Drawing.Skia/SkiaEncoder.cs +++ b/Emby.Drawing.Skia/SkiaEncoder.cs @@ -74,8 +74,9 @@ namespace Emby.Drawing.Skia return typeof(SKBitmap).GetTypeInfo().Assembly.GetName().Version.ToString(); } - private static bool IsWhiteSpace(SKColor color) + private static bool IsTransparent(SKColor color) { + return (color.Red == 255 && color.Green == 255 && color.Blue == 255) || color.Alpha == 0; } @@ -96,11 +97,11 @@ namespace Emby.Drawing.Skia } } - private static bool IsAllWhiteRow(SKBitmap bmp, int row) + private static bool IsTransparentRow(SKBitmap bmp, int row) { for (var i = 0; i < bmp.Width; ++i) { - if (!IsWhiteSpace(bmp.GetPixel(i, row))) + if (!IsTransparent(bmp.GetPixel(i, row))) { return false; } @@ -108,11 +109,11 @@ namespace Emby.Drawing.Skia return true; } - private static bool IsAllWhiteColumn(SKBitmap bmp, int col) + private static bool IsTransparentColumn(SKBitmap bmp, int col) { for (var i = 0; i < bmp.Height; ++i) { - if (!IsWhiteSpace(bmp.GetPixel(col, i))) + if (!IsTransparent(bmp.GetPixel(col, i))) { return false; } @@ -125,7 +126,7 @@ namespace Emby.Drawing.Skia var topmost = 0; for (int row = 0; row < bitmap.Height; ++row) { - if (IsAllWhiteRow(bitmap, row)) + if (IsTransparentRow(bitmap, row)) topmost = row + 1; else break; } @@ -133,7 +134,7 @@ namespace Emby.Drawing.Skia int bottommost = bitmap.Height; for (int row = bitmap.Height - 1; row >= 0; --row) { - if (IsAllWhiteRow(bitmap, row)) + if (IsTransparentRow(bitmap, row)) bottommost = row; else break; } @@ -141,7 +142,7 @@ namespace Emby.Drawing.Skia int leftmost = 0, rightmost = bitmap.Width; for (int col = 0; col < bitmap.Width; ++col) { - if (IsAllWhiteColumn(bitmap, col)) + if (IsTransparentColumn(bitmap, col)) leftmost = col + 1; else break; @@ -149,7 +150,7 @@ namespace Emby.Drawing.Skia for (int col = bitmap.Width - 1; col >= 0; --col) { - if (IsAllWhiteColumn(bitmap, col)) + if (IsTransparentColumn(bitmap, col)) rightmost = col; else break; diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 7f893d8f7..69a190fcb 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -356,8 +356,6 @@ namespace Emby.Server.Implementations /// public override async Task RunStartupTasks() { - await PerformPreInitMigrations().ConfigureAwait(false); - await base.RunStartupTasks().ConfigureAwait(false); await MediaEncoder.Init().ConfigureAwait(false); @@ -375,7 +373,6 @@ namespace Emby.Server.Implementations Logger.Info("Core startup complete"); HttpServer.GlobalResponse = null; - PerformPostInitMigrations(); Logger.Info("Post-init migrations complete"); foreach (var entryPoint in GetExports().ToList()) @@ -410,45 +407,7 @@ namespace Emby.Server.Implementations // Failing under mono } - var result = new JsonSerializer(FileSystemManager, LogManager.GetLogger("JsonSerializer")); - - ServiceStack.Text.JsConfig.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig