From b9082d7e64034c92804a0196de9b52efa2333e88 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 19 Mar 2016 17:17:08 -0400 Subject: [PATCH 1/5] removed ILiveTvItem interface --- MediaBrowser.Controller/Entities/BaseItem.cs | 7 +++++++ MediaBrowser.Controller/LiveTv/ILiveTvItem.cs | 10 ---------- .../LiveTv/ILiveTvRecording.cs | 4 +++- .../LiveTv/LiveTvAudioRecording.cs | 2 -- MediaBrowser.Controller/LiveTv/LiveTvChannel.cs | 8 +------- MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 9 +-------- .../LiveTv/LiveTvVideoRecording.cs | 2 -- .../MediaBrowser.Controller.csproj | 1 - .../LiveTv/LiveTvManager.cs | 7 ++++++- .../LiveTv/LiveTvMediaSourceProvider.cs | 14 ++++++-------- .../Persistence/SqliteItemRepository.cs | 16 ++-------------- .../Api/DashboardService.cs | 12 ++++++++---- 12 files changed, 34 insertions(+), 58 deletions(-) delete mode 100644 MediaBrowser.Controller/LiveTv/ILiveTvItem.cs diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 22f688c424..c9fa1cf79d 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -190,6 +190,13 @@ namespace MediaBrowser.Controller.Entities } } + /// + /// Gets or sets the name of the service. + /// + /// The name of the service. + [IgnoreDataMember] + public string ServiceName { get; set; } + /// /// If this content came from an external service, the id of the content on that service /// diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvItem.cs b/MediaBrowser.Controller/LiveTv/ILiveTvItem.cs deleted file mode 100644 index 36727f4aee..0000000000 --- a/MediaBrowser.Controller/LiveTv/ILiveTvItem.cs +++ /dev/null @@ -1,10 +0,0 @@ -using MediaBrowser.Controller.Entities; - -namespace MediaBrowser.Controller.LiveTv -{ - public interface ILiveTvItem : IHasId - { - string ServiceName { get; set; } - string ExternalId { get; set; } - } -} diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs b/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs index 5dc5f68cd2..257024d01e 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs @@ -9,8 +9,10 @@ using System.Threading.Tasks; namespace MediaBrowser.Controller.LiveTv { - public interface ILiveTvRecording : IHasImages, IHasMediaSources, IHasUserData, ILiveTvItem, IHasStartDate, IHasProgramAttributes + public interface ILiveTvRecording : IHasImages, IHasMediaSources, IHasUserData, IHasStartDate, IHasProgramAttributes { + string ServiceName { get; set; } + string ExternalId { get; set; } string ChannelId { get; } string MediaType { get; } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs index 04e19c92a8..2657ade423 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs @@ -57,8 +57,6 @@ namespace MediaBrowser.Controller.LiveTv return name + "-" + Name + (EpisodeTitle ?? string.Empty); } - public string ServiceName { get; set; } - /// /// Gets a value indicating whether this instance is owned item. /// diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index bc0b40b30c..24ec3f5e16 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -11,7 +11,7 @@ using System.Runtime.Serialization; namespace MediaBrowser.Controller.LiveTv { - public class LiveTvChannel : BaseItem, IHasMediaSources, ILiveTvItem + public class LiveTvChannel : BaseItem, IHasMediaSources { /// /// Gets the user data key. @@ -59,12 +59,6 @@ namespace MediaBrowser.Controller.LiveTv /// The type of the channel. public ChannelType ChannelType { get; set; } - /// - /// Gets or sets the name of the service. - /// - /// The name of the service. - public string ServiceName { get; set; } - [IgnoreDataMember] public override LocationType LocationType { diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index c01df74642..684af9974d 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -11,7 +11,7 @@ using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.LiveTv { - public class LiveTvProgram : BaseItem, ILiveTvItem, IHasLookupInfo, IHasStartDate, IHasProgramAttributes + public class LiveTvProgram : BaseItem, IHasLookupInfo, IHasStartDate, IHasProgramAttributes { /// /// Gets the user data key. @@ -39,13 +39,6 @@ namespace MediaBrowser.Controller.LiveTv return base.CreateUserDataKey(); } - /// - /// Gets or sets the name. - /// - /// The name. - [IgnoreDataMember] - public string ServiceName { get; set; } - [IgnoreDataMember] public override SourceType SourceType { diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs index f298e89b70..6dff664388 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -72,8 +72,6 @@ namespace MediaBrowser.Controller.LiveTv return base.CreateUserDataKey(); } - public string ServiceName { get; set; } - [IgnoreDataMember] public override string MediaType { diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index be041281ff..f4a5c04380 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -202,7 +202,6 @@ - diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index e54adc0c5c..5949a65371 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -358,7 +358,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv return list; } - private ILiveTvService GetService(ILiveTvItem item) + private ILiveTvService GetService(ILiveTvRecording item) + { + return GetService(item.ServiceName); + } + + private ILiveTvService GetService(BaseItem item) { return GetService(item.ServiceName); } diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs index ff102b0f79..d3bb87bc70 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs @@ -36,15 +36,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv public Task> GetMediaSources(IHasMediaSources item, CancellationToken cancellationToken) { - var channelItem = item as ILiveTvItem; + var baseItem = (BaseItem)item; - if (channelItem != null) + if (baseItem.SourceType == SourceType.LiveTV) { - var hasMetadata = (IHasMetadata)channelItem; - - if (string.IsNullOrWhiteSpace(hasMetadata.Path)) + if (string.IsNullOrWhiteSpace(baseItem.Path)) { - return GetMediaSourcesInternal(channelItem, cancellationToken); + return GetMediaSourcesInternal(item, cancellationToken); } } @@ -54,8 +52,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv // Do not use a pipe here because Roku http requests to the server will fail, without any explicit error message. private const char StreamIdDelimeter = '_'; private const string StreamIdDelimeterString = "_"; - - private async Task> GetMediaSourcesInternal(ILiveTvItem item, CancellationToken cancellationToken) + + private async Task> GetMediaSourcesInternal(IHasMediaSources item, CancellationToken cancellationToken) { IEnumerable sources; diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs index 3f50278f60..50662c90fa 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs @@ -719,15 +719,7 @@ namespace MediaBrowser.Server.Implementations.Persistence _saveItemCommand.GetParameter(index++).Value = null; } - var tvItem = item as ILiveTvItem; - if (tvItem != null) - { - _saveItemCommand.GetParameter(index++).Value = tvItem.ServiceName; - } - else - { - _saveItemCommand.GetParameter(index++).Value = null; - } + _saveItemCommand.GetParameter(index++).Value = item.ServiceName; _saveItemCommand.GetParameter(index++).Value = string.Join("|", item.Tags.ToArray()); _saveItemCommand.GetParameter(index++).Value = item.IsFolder; @@ -1095,11 +1087,7 @@ namespace MediaBrowser.Server.Implementations.Persistence if (!reader.IsDBNull(43)) { - var tvItem = item as ILiveTvItem; - if (tvItem != null) - { - tvItem.ServiceName = reader.GetString(43); - } + item.ServiceName = reader.GetString(43); } if (!reader.IsDBNull(44)) diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index ab9ff8e6f2..ab8b2a6738 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -308,9 +308,9 @@ namespace MediaBrowser.WebDashboard.Api if (!string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase)) { - var versionedBowerPath = Path.Combine(Path.GetDirectoryName(bowerPath), "bower_components" + _appHost.ApplicationVersion); - Directory.Move(bowerPath, versionedBowerPath); - bowerPath = versionedBowerPath; + //var versionedBowerPath = Path.Combine(Path.GetDirectoryName(bowerPath), "bower_components" + _appHost.ApplicationVersion); + //Directory.Move(bowerPath, versionedBowerPath); + //bowerPath = versionedBowerPath; } DeleteFilesByExtension(bowerPath, ".log"); @@ -340,7 +340,11 @@ namespace MediaBrowser.WebDashboard.Api DeleteFoldersByName(bowerPath, "guides"); DeleteFoldersByName(bowerPath, "grunt"); DeleteFoldersByName(bowerPath, "rollups"); - DeleteFoldersByName(Path.Combine(bowerPath, "emby-webcomponents"), "fonts"); + + if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase)) + { + DeleteFoldersByName(Path.Combine(bowerPath, "emby-webcomponents"), "fonts"); + } _fileSystem.DeleteDirectory(Path.Combine(bowerPath, "jquery", "src"), true); From b97491cdad6d5df3ba2bf050321e06129d281bd0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 19 Mar 2016 17:34:43 -0400 Subject: [PATCH 2/5] reduce use of ILiveTvRecording --- MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 6 +++--- .../LiveTv/LiveTvManager.cs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index a8f847f53a..bd25b23f77 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The recording. /// Task. - Task DeleteRecording(ILiveTvRecording recording); + Task DeleteRecording(BaseItem recording); /// /// Cancels the timer. @@ -156,7 +156,7 @@ namespace MediaBrowser.Controller.LiveTv /// The identifier. /// The cancellation token. /// LiveTvRecording. - Task GetInternalRecording(string id, CancellationToken cancellationToken); + Task GetInternalRecording(string id, CancellationToken cancellationToken); /// /// Gets the recording stream. @@ -396,7 +396,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The recording. /// Task. - Task OnRecordingFileDeleted(ILiveTvRecording recording); + Task OnRecordingFileDeleted(BaseItem recording); /// /// Gets the sat ini mappings. diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 5949a65371..47379fcb05 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -300,7 +300,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv return _libraryManager.GetItemById(id) as LiveTvProgram; } - public async Task GetInternalRecording(string id, CancellationToken cancellationToken) + public async Task GetInternalRecording(string id, CancellationToken cancellationToken) { if (string.IsNullOrWhiteSpace(id)) { @@ -313,7 +313,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv }, cancellationToken).ConfigureAwait(false); - return result.Items.FirstOrDefault() as ILiveTvRecording; + return result.Items.FirstOrDefault(); } private readonly SemaphoreSlim _liveStreamSemaphore = new SemaphoreSlim(1, 1); @@ -1698,7 +1698,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv }; } - public Task OnRecordingFileDeleted(ILiveTvRecording recording) + public Task OnRecordingFileDeleted(BaseItem recording) { var service = GetService(recording); @@ -1720,10 +1720,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv throw new ResourceNotFoundException(string.Format("Recording with Id {0} not found", recordingId)); } - await DeleteRecording(recording).ConfigureAwait(false); + await DeleteRecording((BaseItem)recording).ConfigureAwait(false); } - public async Task DeleteRecording(ILiveTvRecording recording) + public async Task DeleteRecording(BaseItem recording) { var service = GetService(recording.ServiceName); From 77e36768e4def7cb62f7cf0b855f01c15dcaf922 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 19 Mar 2016 17:55:42 -0400 Subject: [PATCH 3/5] removed dead code --- .../MediaBrowser.Model.Portable.csproj | 3 - .../MediaBrowser.Model.net35.csproj | 3 - .../Configuration/ServerConfiguration.cs | 6 -- MediaBrowser.Model/Dto/BaseItemDto.cs | 5 ++ MediaBrowser.Model/Dto/ItemByNameCounts.cs | 63 ------------------- MediaBrowser.Model/MediaBrowser.Model.csproj | 1 - .../ServerConfigurationManager.cs | 23 ------- .../Dto/DtoService.cs | 1 + 8 files changed, 6 insertions(+), 99 deletions(-) delete mode 100644 MediaBrowser.Model/Dto/ItemByNameCounts.cs diff --git a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj index 5dcfded6f0..54fdc64005 100644 --- a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj +++ b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj @@ -470,9 +470,6 @@ Dto\ImageOptions.cs - - Dto\ItemByNameCounts.cs - Dto\ItemCounts.cs diff --git a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj index 6c484ffc94..473186a46e 100644 --- a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj +++ b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj @@ -444,9 +444,6 @@ Dto\ImageOptions.cs - - Dto\ItemByNameCounts.cs - Dto\ItemCounts.cs diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 009068deae..bbc6195ff5 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -62,12 +62,6 @@ namespace MediaBrowser.Model.Configuration /// true if this instance is port authorized; otherwise, false. public bool IsPortAuthorized { get; set; } - /// - /// Gets or sets the item by name path. - /// - /// The item by name path. - public string ItemsByNamePath { get; set; } - /// /// Gets or sets the metadata path. /// diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index d9b06dcfd3..8f617cadfb 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -792,6 +792,11 @@ namespace MediaBrowser.Model.Dto /// The locked fields. public List LockedFields { get; set; } + /// + /// Gets or sets the trailer count. + /// + /// The trailer count. + public int? TrailerCount { get; set; } /// /// Gets or sets the movie count. /// diff --git a/MediaBrowser.Model/Dto/ItemByNameCounts.cs b/MediaBrowser.Model/Dto/ItemByNameCounts.cs deleted file mode 100644 index 7c51f07bd1..0000000000 --- a/MediaBrowser.Model/Dto/ItemByNameCounts.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; - -namespace MediaBrowser.Model.Dto -{ - /// - /// Class ItemByNameCounts - /// - public class ItemByNameCounts - { - public string UserId { get; set; } - - /// - /// Gets or sets the total count. - /// - /// The total count. - public int TotalCount { get; set; } - /// - /// Gets or sets the adult video count. - /// - /// The adult video count. - public int AdultVideoCount { get; set; } - /// - /// Gets or sets the movie count. - /// - /// The movie count. - public int MovieCount { get; set; } - /// - /// Gets or sets the series count. - /// - /// The series count. - public int SeriesCount { get; set; } - /// - /// Gets or sets the episode count. - /// - /// The episode count. - public int EpisodeCount { get; set; } - /// - /// Gets or sets the game count. - /// - /// The game count. - public int GameCount { get; set; } - /// - /// Gets or sets the trailer count. - /// - /// The trailer count. - public int TrailerCount { get; set; } - /// - /// Gets or sets the song count. - /// - /// The song count. - public int SongCount { get; set; } - /// - /// Gets or sets the album count. - /// - /// The album count. - public int AlbumCount { get; set; } - /// - /// Gets or sets the music video count. - /// - /// The music video count. - public int MusicVideoCount { get; set; } - } -} diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 2500a27a82..41952963c6 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -215,7 +215,6 @@ - diff --git a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs index 1a5c35df83..7db457c6ed 100644 --- a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -145,7 +145,6 @@ namespace MediaBrowser.Server.Implementations.Configuration { var newConfig = (ServerConfiguration)newConfiguration; - ValidateItemByNamePath(newConfig); ValidatePathSubstitutions(newConfig); ValidateMetadataPath(newConfig); ValidateSslCertificate(newConfig); @@ -189,28 +188,6 @@ namespace MediaBrowser.Server.Implementations.Configuration } } - /// - /// Replaces the item by name path. - /// - /// The new configuration. - /// - private void ValidateItemByNamePath(ServerConfiguration newConfig) - { - var newPath = newConfig.ItemsByNamePath; - - if (!string.IsNullOrWhiteSpace(newPath) - && !string.Equals(Configuration.ItemsByNamePath ?? string.Empty, newPath)) - { - // Validate - if (!FileSystem.DirectoryExists(newPath)) - { - throw new DirectoryNotFoundException(string.Format("{0} does not exist.", newPath)); - } - - EnsureWriteAccess(newPath); - } - } - /// /// Validates the metadata path. /// diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 3b63eccfc0..3ead1a8359 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -457,6 +457,7 @@ namespace MediaBrowser.Server.Implementations.Dto dto.EpisodeCount = taggedItems.Count(i => i is Episode); dto.GameCount = taggedItems.Count(i => i is Game); dto.MovieCount = taggedItems.Count(i => i is Movie); + dto.TrailerCount = taggedItems.Count(i => i is Trailer); dto.MusicVideoCount = taggedItems.Count(i => i is MusicVideo); dto.SeriesCount = taggedItems.Count(i => i is Series); dto.SongCount = taggedItems.Count(i => i is Audio); From b2d1c0dee32189c93303c964a1a512f89db85e10 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 19 Mar 2016 18:31:00 -0400 Subject: [PATCH 4/5] update subtitle download setting --- MediaBrowser.Model/Providers/SubtitleOptions.cs | 2 +- MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs | 2 +- MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs | 10 +++++----- .../MediaInfo/SubtitleScheduledTask.cs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MediaBrowser.Model/Providers/SubtitleOptions.cs b/MediaBrowser.Model/Providers/SubtitleOptions.cs index 84f01e0b7a..2b15c0e1f1 100644 --- a/MediaBrowser.Model/Providers/SubtitleOptions.cs +++ b/MediaBrowser.Model/Providers/SubtitleOptions.cs @@ -2,7 +2,7 @@ namespace MediaBrowser.Model.Providers { public class SubtitleOptions { - public bool SkipIfGraphicalSubtitlesPresent { get; set; } + public bool SkipIfEmbeddedSubtitlesPresent { get; set; } public bool SkipIfAudioTrackMatches { get; set; } public string[] DownloadLanguages { get; set; } public bool DownloadMovieSubtitles { get; set; } diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs index ee05a89a85..5f556bffb4 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs @@ -532,7 +532,7 @@ namespace MediaBrowser.Providers.MediaInfo _subtitleManager) .DownloadSubtitles(video, currentStreams.Concat(externalSubtitleStreams).ToList(), - subtitleOptions.SkipIfGraphicalSubtitlesPresent, + subtitleOptions.SkipIfEmbeddedSubtitlesPresent, subtitleOptions.SkipIfAudioTrackMatches, subtitleOptions.DownloadLanguages, cancellationToken).ConfigureAwait(false); diff --git a/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs b/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs index 6230e73475..d822890326 100644 --- a/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs +++ b/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs @@ -26,7 +26,7 @@ namespace MediaBrowser.Providers.MediaInfo public async Task> DownloadSubtitles(Video video, List mediaStreams, - bool skipIfGraphicalSubtitlesPresent, + bool skipIfEmbeddedSubtitlesPresent, bool skipIfAudioTrackMatches, IEnumerable languages, CancellationToken cancellationToken) @@ -59,7 +59,7 @@ namespace MediaBrowser.Providers.MediaInfo { try { - var downloaded = await DownloadSubtitles(video, mediaStreams, skipIfGraphicalSubtitlesPresent, skipIfAudioTrackMatches, lang, mediaType, cancellationToken) + var downloaded = await DownloadSubtitles(video, mediaStreams, skipIfEmbeddedSubtitlesPresent, skipIfAudioTrackMatches, lang, mediaType, cancellationToken) .ConfigureAwait(false); if (downloaded) @@ -78,7 +78,7 @@ namespace MediaBrowser.Providers.MediaInfo private async Task DownloadSubtitles(Video video, List mediaStreams, - bool skipIfGraphicalSubtitlesPresent, + bool skipIfEmbeddedSubtitlesPresent, bool skipIfAudioTrackMatches, string language, VideoContentType mediaType, @@ -107,8 +107,8 @@ namespace MediaBrowser.Providers.MediaInfo } // There's an internal subtitle stream for this language - if (skipIfGraphicalSubtitlesPresent && - mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle && !i.IsTextSubtitleStream && string.Equals(i.Language, language, StringComparison.OrdinalIgnoreCase))) + if (skipIfEmbeddedSubtitlesPresent && + mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle && !i.IsExternal && string.Equals(i.Language, language, StringComparison.OrdinalIgnoreCase))) { return false; } diff --git a/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs b/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs index 4953621f5a..b8b17cefee 100644 --- a/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs +++ b/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs @@ -114,7 +114,7 @@ namespace MediaBrowser.Providers.MediaInfo _subtitleManager) .DownloadSubtitles(video, mediaStreams, - options.SkipIfGraphicalSubtitlesPresent, + options.SkipIfEmbeddedSubtitlesPresent, options.SkipIfAudioTrackMatches, options.DownloadLanguages, cancellationToken).ConfigureAwait(false); From bcda2a8f0eaa304a946da29485cbc695de4b1519 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 19 Mar 2016 18:45:11 -0400 Subject: [PATCH 5/5] update channels --- .../Channels/IChannelItem.cs | 11 +++++++++++ .../Channels/IChannelMediaItem.cs | 18 ++++++++++++++++++ .../MediaBrowser.Controller.csproj | 2 ++ .../LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs | 2 +- 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 MediaBrowser.Controller/Channels/IChannelItem.cs create mode 100644 MediaBrowser.Controller/Channels/IChannelMediaItem.cs diff --git a/MediaBrowser.Controller/Channels/IChannelItem.cs b/MediaBrowser.Controller/Channels/IChannelItem.cs new file mode 100644 index 0000000000..9b5f0359bd --- /dev/null +++ b/MediaBrowser.Controller/Channels/IChannelItem.cs @@ -0,0 +1,11 @@ +using MediaBrowser.Controller.Entities; + +namespace MediaBrowser.Controller.Channels +{ + public interface IChannelItem : IHasImages, IHasTags + { + string ChannelId { get; set; } + + string ExternalId { get; set; } + } +} diff --git a/MediaBrowser.Controller/Channels/IChannelMediaItem.cs b/MediaBrowser.Controller/Channels/IChannelMediaItem.cs new file mode 100644 index 0000000000..60a29da90b --- /dev/null +++ b/MediaBrowser.Controller/Channels/IChannelMediaItem.cs @@ -0,0 +1,18 @@ +using MediaBrowser.Model.Channels; +using MediaBrowser.Model.Entities; +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Channels +{ + public interface IChannelMediaItem : IChannelItem + { + long? RunTimeTicks { get; set; } + string MediaType { get; } + + ChannelMediaContentType ContentType { get; set; } + + ExtraType? ExtraType { get; set; } + + List ChannelMediaSources { get; set; } + } +} \ No newline at end of file diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index f4a5c04380..e811d75878 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -85,8 +85,10 @@ + + diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs index cdeb6dfa86..c417cc09c4 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs @@ -100,7 +100,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp { if (string.IsNullOrWhiteSpace(info.M3UUrl)) { - return; + //return; } await _liveTvManager.SaveTunerHost(new TunerHostInfo