diff options
| -rw-r--r-- | Emby.Drawing.Skia/SkiaEncoder.cs | 19 | ||||
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 81 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Data/SqliteItemRepository.cs | 38 | ||||
| -rw-r--r-- | Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs | 5 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Session/SessionManager.cs | 1 | ||||
| -rw-r--r-- | MediaBrowser.Api/LiveTv/LiveTvService.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 1 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Video.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Model/LiveTv/LiveTvOptions.cs | 1 | ||||
| -rw-r--r-- | MediaBrowser.Model/Querying/ItemFields.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Providers/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 /// </summary> 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<IServerEntryPoint>().ToList()) @@ -410,45 +407,7 @@ namespace Emby.Server.Implementations // Failing under mono } - var result = new JsonSerializer(FileSystemManager, LogManager.GetLogger("JsonSerializer")); - - ServiceStack.Text.JsConfig<LiveTvProgram>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<LiveTvChannel>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<LiveTvVideoRecording>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<LiveTvAudioRecording>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Series>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Audio>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<MusicAlbum>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<MusicArtist>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<MusicGenre>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<MusicVideo>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Movie>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Playlist>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<AudioPodcast>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<AudioBook>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Trailer>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<BoxSet>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Episode>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Season>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Book>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<CollectionFolder>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Folder>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Game>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<GameGenre>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<GameSystem>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Genre>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Person>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Photo>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<PhotoAlbum>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Studio>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<UserRootFolder>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<UserView>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Video>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Year>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<Channel>.ExcludePropertyNames = new[] { "ProviderIds" }; - ServiceStack.Text.JsConfig<AggregateFolder>.ExcludePropertyNames = new[] { "ProviderIds" }; - - return result; + return new JsonSerializer(FileSystemManager, LogManager.GetLogger("JsonSerializer")); } public override Task Init(IProgress<double> progress) @@ -466,44 +425,6 @@ namespace Emby.Server.Implementations return base.Init(progress); } - private async Task PerformPreInitMigrations() - { - var migrations = new List<IVersionMigration> - { - }; - - foreach (var task in migrations) - { - try - { - await task.Run().ConfigureAwait(false); - } - catch (Exception ex) - { - Logger.ErrorException("Error running migration", ex); - } - } - } - - private void PerformPostInitMigrations() - { - var migrations = new List<IVersionMigration> - { - }; - - foreach (var task in migrations) - { - try - { - task.Run(); - } - catch (Exception ex) - { - Logger.ErrorException("Error running migration", ex); - } - } - } - protected abstract IConnectManager CreateConnectManager(); protected abstract ISyncManager CreateSyncManager(); diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index fc47809ac..7fb2f02db 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -202,7 +202,6 @@ namespace Emby.Server.Implementations.Data AddColumn(db, "TypedBaseItems", "ForcedSortName", "Text", existingColumnNames); AddColumn(db, "TypedBaseItems", "RunTimeTicks", "BIGINT", existingColumnNames); AddColumn(db, "TypedBaseItems", "HomePageUrl", "Text", existingColumnNames); - AddColumn(db, "TypedBaseItems", "DisplayMediaType", "Text", existingColumnNames); AddColumn(db, "TypedBaseItems", "DateCreated", "DATETIME", existingColumnNames); AddColumn(db, "TypedBaseItems", "DateModified", "DATETIME", existingColumnNames); AddColumn(db, "TypedBaseItems", "IsSeries", "BIT", existingColumnNames); @@ -307,6 +306,8 @@ namespace Emby.Server.Implementations.Data "drop index if exists idx_TypeSeriesPresentationUniqueKey", "drop index if exists idx_SeriesPresentationUniqueKey", "drop index if exists idx_TypeSeriesPresentationUniqueKey2", + "drop index if exists idx_AncestorIds3", + "drop index if exists idx_AncestorIds4", "create index if not exists idx_PathTypedBaseItems on TypedBaseItems(Path)", "create index if not exists idx_ParentIdTypedBaseItems on TypedBaseItems(ParentId)", @@ -417,7 +418,6 @@ namespace Emby.Server.Implementations.Data "ProductionYear", "OfficialRating", "HomePageUrl", - "DisplayMediaType", "ForcedSortName", "RunTimeTicks", "DateCreated", @@ -534,7 +534,6 @@ namespace Emby.Server.Implementations.Data "ForcedSortName", "RunTimeTicks", "HomePageUrl", - "DisplayMediaType", "DateCreated", "DateModified", "PreferredMetadataLanguage", @@ -811,7 +810,6 @@ namespace Emby.Server.Implementations.Data saveItemStatement.TryBind("@RunTimeTicks", item.RunTimeTicks); saveItemStatement.TryBind("@HomePageUrl", item.HomePageUrl); - saveItemStatement.TryBindNull("@DisplayMediaType"); saveItemStatement.TryBind("@DateCreated", item.DateCreated); saveItemStatement.TryBind("@DateModified", item.DateModified); @@ -1218,14 +1216,15 @@ namespace Emby.Server.Implementations.Data { return false; } - if (type == typeof(Season)) - { - return false; - } - if (type == typeof(MusicArtist)) - { - return false; - } + } + + if (type == typeof(Season)) + { + return false; + } + if (type == typeof(MusicArtist)) + { + return false; } if (type == typeof(Person)) @@ -1573,19 +1572,6 @@ namespace Emby.Server.Implementations.Data index++; } - var video = item as Video; - if (HasField(query, ItemFields.DisplayMediaType)) - { - if (video != null) - { - if (!reader.IsDBNull(index)) - { - video.DisplayMediaType = reader.GetString(index); - } - } - index++; - } - if (HasField(query, ItemFields.SortName)) { if (!reader.IsDBNull(index)) @@ -1737,6 +1723,7 @@ namespace Emby.Server.Implementations.Data index++; } + var video = item as Video; if (video != null) { if (!reader.IsDBNull(index)) @@ -2248,7 +2235,6 @@ namespace Emby.Server.Implementations.Data { case ItemFields.HomePageUrl: case ItemFields.CustomRating: - case ItemFields.DisplayMediaType: case ItemFields.ProductionLocations: case ItemFields.Settings: case ItemFields.OriginalTitle: diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs index b6ba8b45c..eae29bee7 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs @@ -68,7 +68,10 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun { var id = ChannelIdPrefix + i.GuideNumber; - id += '_' + (i.GuideName ?? string.Empty).GetMD5().ToString("N"); + if (!info.EnableNewHdhrChannelIds) + { + id += '_' + (i.GuideName ?? string.Empty).GetMD5().ToString("N"); + } return id; } diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index 9a1a229c5..dc7e83992 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -1670,7 +1670,6 @@ namespace Emby.Server.Implementations.Session dtoOptions.Fields.Remove(ItemFields.DateLastMediaAdded); dtoOptions.Fields.Remove(ItemFields.DateLastRefreshed); dtoOptions.Fields.Remove(ItemFields.DateLastSaved); - dtoOptions.Fields.Remove(ItemFields.DisplayMediaType); dtoOptions.Fields.Remove(ItemFields.DisplayPreferencesId); dtoOptions.Fields.Remove(ItemFields.Etag); dtoOptions.Fields.Remove(ItemFields.ExternalEtag); diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs index 09d4cdfa9..e2961f630 100644 --- a/MediaBrowser.Api/LiveTv/LiveTvService.cs +++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs @@ -852,6 +852,8 @@ namespace MediaBrowser.Api.LiveTv public async Task<object> Post(AddTunerHost request) { + request.EnableNewHdhrChannelIds = true; + var result = await _liveTvManager.SaveTunerHost(request).ConfigureAwait(false); return ToOptimizedResult(result); } diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 8cc90db7d..a6418418e 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1246,6 +1246,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the provider ids. /// </summary> /// <value>The provider ids.</value> + [IgnoreDataMember] public Dictionary<string, string> ProviderIds { get; set; } [IgnoreDataMember] diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index fbeefbbd9..3b166db92 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -53,12 +53,6 @@ namespace MediaBrowser.Controller.Entities } } - /// <summary> - /// Gets or sets the display type of the media. - /// </summary> - /// <value>The display type of the media.</value> - public string DisplayMediaType { get; set; } - [IgnoreDataMember] public override bool SupportsPositionTicksResume { diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs index 25185b4dd..a1df35b12 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs @@ -47,6 +47,7 @@ namespace MediaBrowser.Model.LiveTv public bool ImportFavoritesOnly { get; set; } public bool AllowHWTranscoding { get; set; } public bool EnableStreamLooping { get; set; } + public bool EnableNewHdhrChannelIds { get; set; } public TunerHostInfo() { diff --git a/MediaBrowser.Model/Querying/ItemFields.cs b/MediaBrowser.Model/Querying/ItemFields.cs index 6cc6ba329..f9829c329 100644 --- a/MediaBrowser.Model/Querying/ItemFields.cs +++ b/MediaBrowser.Model/Querying/ItemFields.cs @@ -63,11 +63,6 @@ DisplayPreferencesId, /// <summary> - /// The display media type - /// </summary> - DisplayMediaType, - - /// <summary> /// The etag /// </summary> Etag, diff --git a/MediaBrowser.Providers/Manager/ProviderUtils.cs b/MediaBrowser.Providers/Manager/ProviderUtils.cs index af91f5e02..41612321b 100644 --- a/MediaBrowser.Providers/Manager/ProviderUtils.cs +++ b/MediaBrowser.Providers/Manager/ProviderUtils.cs @@ -202,23 +202,6 @@ namespace MediaBrowser.Providers.Manager } } - //if (!lockedFields.Contains(MetadataFields.DisplayMediaType)) - { - var targetVideo = target as Video; - var sourceVideo = source as Video; - if (sourceVideo != null && targetVideo != null) - { - if (replaceData || string.IsNullOrEmpty(targetVideo.DisplayMediaType)) - { - // Safeguard against incoming data having an emtpy name - if (!string.IsNullOrWhiteSpace(sourceVideo.DisplayMediaType)) - { - targetVideo.DisplayMediaType = sourceVideo.DisplayMediaType; - } - } - } - } - if (mergeMetadataSettings) { MergeMetadataSettings(source, target); |
