From 3862207a7352feddfae6416ba2dff4e78620089a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 31 Aug 2016 16:46:09 -0400 Subject: move channel view setting to global --- MediaBrowser.Server.Implementations/Library/UserViewManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Library') diff --git a/MediaBrowser.Server.Implementations/Library/UserViewManager.cs b/MediaBrowser.Server.Implementations/Library/UserViewManager.cs index 5fffa3d1f..2cbee7c97 100644 --- a/MediaBrowser.Server.Implementations/Library/UserViewManager.cs +++ b/MediaBrowser.Server.Implementations/Library/UserViewManager.cs @@ -120,8 +120,8 @@ namespace MediaBrowser.Server.Implementations.Library }, cancellationToken).ConfigureAwait(false); var channels = channelResult.Items; - - if (user.Configuration.EnableChannelView && channels.Length > 0) + + if (_config.Configuration.EnableChannelView && channels.Length > 0) { list.Add(await _channelManager.GetInternalChannelFolder(cancellationToken).ConfigureAwait(false)); } -- cgit v1.2.3 From 2d7c82d0dd8b51af58a2e187ef30639fdbfd918a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 3 Sep 2016 13:16:36 -0400 Subject: add loopback handler --- MediaBrowser.Api/ItemUpdateService.cs | 5 +- MediaBrowser.Controller/IServerApplicationHost.cs | 2 + .../MediaBrowser.LocalMetadata.csproj | 2 - .../Parsers/SeasonXmlParser.cs | 48 ------------------ .../Providers/SeasonXmlProvider.cs | 46 ----------------- .../Subtitles/SubtitleEncoder.cs | 5 +- .../Library/Resolvers/TV/SeriesResolver.cs | 15 ++---- .../Udp/UdpServer.cs | 57 ++++++++++++++-------- MediaBrowser.Server.Mono/Native/BaseMonoApp.cs | 5 ++ .../ApplicationHost.cs | 5 ++ MediaBrowser.Server.Startup.Common/INativeApp.cs | 2 + MediaBrowser.ServerApplication/MainStartup.cs | 9 ---- .../Native/LoopbackUtil.cs | 4 +- .../Native/WindowsApp.cs | 5 ++ MediaBrowser.sln | 3 ++ Nuget/MediaBrowser.Common.Internal.nuspec | 4 +- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 +- 18 files changed, 79 insertions(+), 144 deletions(-) delete mode 100644 MediaBrowser.LocalMetadata/Parsers/SeasonXmlParser.cs delete mode 100644 MediaBrowser.LocalMetadata/Providers/SeasonXmlProvider.cs (limited to 'MediaBrowser.Server.Implementations/Library') diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index 2778cfe29..cda7ce0c6 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -70,12 +70,13 @@ namespace MediaBrowser.Api Cultures = _localizationManager.GetCultures().ToList() }; - if (!item.IsVirtualItem && !(item is ICollectionFolder) && !(item is UserView) && !(item is AggregateFolder) && !(item is LiveTvChannel) && !(item is IItemByName)) + if (!item.IsVirtualItem && !(item is ICollectionFolder) && !(item is UserView) && !(item is AggregateFolder) && !(item is LiveTvChannel) && !(item is IItemByName) && + item.SourceType == SourceType.Library) { var inheritedContentType = _libraryManager.GetInheritedContentType(item); var configuredContentType = _libraryManager.GetConfiguredContentType(item); - if (string.IsNullOrWhiteSpace(inheritedContentType) || string.Equals(inheritedContentType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(configuredContentType)) + if (string.IsNullOrWhiteSpace(inheritedContentType) || !string.IsNullOrWhiteSpace(configuredContentType)) { info.ContentTypeOptions = GetContentTypeOptions(true); info.ContentType = configuredContentType; diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index f4c0e7658..d6744e804 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -89,5 +89,7 @@ namespace MediaBrowser.Controller string GetLocalApiUrl(IPAddress ipAddress); void LaunchUrl(string url); + + void EnableLoopback(string appName); } } diff --git a/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj b/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj index 134385765..ac127458e 100644 --- a/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj +++ b/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj @@ -63,7 +63,6 @@ - @@ -75,7 +74,6 @@ - diff --git a/MediaBrowser.LocalMetadata/Parsers/SeasonXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/SeasonXmlParser.cs deleted file mode 100644 index 9769ffc72..000000000 --- a/MediaBrowser.LocalMetadata/Parsers/SeasonXmlParser.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Xml; -using MediaBrowser.Controller.Entities.TV; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Logging; - -namespace MediaBrowser.LocalMetadata.Parsers -{ - public class SeasonXmlParser : BaseItemXmlParser - { - public SeasonXmlParser(ILogger logger, IProviderManager providerManager) - : base(logger, providerManager) - { - } - - /// - /// Fetches the data from XML node. - /// - /// The reader. - /// The result. - protected override void FetchDataFromXmlNode(XmlReader reader, MetadataResult result) - { - var item = result.Item; - - switch (reader.Name) - { - case "SeasonNumber": - { - var number = reader.ReadElementContentAsString(); - - if (!string.IsNullOrWhiteSpace(number)) - { - int num; - - if (int.TryParse(number, out num)) - { - item.IndexNumber = num; - } - } - break; - } - - default: - base.FetchDataFromXmlNode(reader, result); - break; - } - } - } -} diff --git a/MediaBrowser.LocalMetadata/Providers/SeasonXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/SeasonXmlProvider.cs deleted file mode 100644 index 75af906cb..000000000 --- a/MediaBrowser.LocalMetadata/Providers/SeasonXmlProvider.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.IO; -using System.Threading; -using CommonIO; -using MediaBrowser.Controller.Entities.TV; -using MediaBrowser.Controller.Providers; -using MediaBrowser.LocalMetadata.Parsers; -using MediaBrowser.Model.Logging; - -namespace MediaBrowser.LocalMetadata.Providers -{ - /// - /// Class SeriesProviderFromXml - /// - public class SeasonXmlProvider : BaseXmlProvider, IHasOrder - { - private readonly ILogger _logger; - private readonly IProviderManager _providerManager; - - public SeasonXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) - : base(fileSystem) - { - _logger = logger; - _providerManager = providerManager; - } - - protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) - { - new SeasonXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken); - } - - protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService) - { - return directoryService.GetFile(Path.Combine(info.Path, "season.xml")); - } - - public int Order - { - get - { - // After Xbmc - return 1; - } - } - } -} - diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index a63aca11b..dc5e69283 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -818,14 +818,17 @@ namespace MediaBrowser.MediaEncoding.Subtitles public string GetSubtitleFileCharacterSetFromLanguage(string language) { + // https://developer.xamarin.com/api/type/System.Text.Encoding/ + switch (language.ToLower()) { + case "hun": + return "windows-1252"; case "pol": case "cze": case "ces": case "slo": case "slk": - case "hun": case "slv": case "srp": case "hrv": diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs index aefb29f1a..4c6254330 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs @@ -54,14 +54,14 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV { if (args.IsDirectory) { + if (args.HasParent()) + { + return null; + } + var collectionType = args.GetCollectionType(); if (string.Equals(collectionType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase)) { - if (args.HasParent()) - { - return null; - } - var configuredContentType = _libraryManager.GetConfiguredContentType(args.Path); if (!string.Equals(configuredContentType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase)) { @@ -76,11 +76,6 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV { if (string.IsNullOrWhiteSpace(collectionType)) { - if (args.HasParent()) - { - return null; - } - if (args.Parent.IsRoot) { return null; diff --git a/MediaBrowser.Server.Implementations/Udp/UdpServer.cs b/MediaBrowser.Server.Implementations/Udp/UdpServer.cs index 9d60dcd40..241ceaf65 100644 --- a/MediaBrowser.Server.Implementations/Udp/UdpServer.cs +++ b/MediaBrowser.Server.Implementations/Udp/UdpServer.cs @@ -30,7 +30,7 @@ namespace MediaBrowser.Server.Implementations.Udp private bool _isDisposed; - private readonly List>> _responders = new List>>(); + private readonly List>> _responders = new List>>(); private readonly IServerApplicationHost _appHost; private readonly IJsonSerializer _json; @@ -49,42 +49,35 @@ namespace MediaBrowser.Server.Implementations.Udp _appHost = appHost; _json = json; - AddMessageResponder("who is EmbyServer?", RespondToV2Message); - AddMessageResponder("who is MediaBrowserServer_v2?", RespondToV2Message); + AddMessageResponder("who is EmbyServer?", true, RespondToV2Message); + AddMessageResponder("who is MediaBrowserServer_v2?", false, RespondToV2Message); } - private void AddMessageResponder(string message, Action responder) + private void AddMessageResponder(string message, bool isSubstring, Func responder) { - var expectedMessageBytes = Encoding.UTF8.GetBytes(message); - - _responders.Add(new Tuple>(message, expectedMessageBytes, responder)); + _responders.Add(new Tuple>(message, isSubstring, responder)); } /// /// Raises the event. /// /// The instance containing the event data. - private void OnMessageReceived(UdpMessageReceivedEventArgs e) + private async void OnMessageReceived(UdpMessageReceivedEventArgs e) { - var responder = _responders.FirstOrDefault(i => i.Item2.SequenceEqual(e.Bytes)); var encoding = Encoding.UTF8; + var responder = GetResponder(e.Bytes, encoding); if (responder == null) { - var text = Encoding.Unicode.GetString(e.Bytes); - responder = _responders.FirstOrDefault(i => string.Equals(i.Item1, text, StringComparison.OrdinalIgnoreCase)); - - if (responder != null) - { - encoding = Encoding.Unicode; - } + encoding = Encoding.Unicode; + responder = GetResponder(e.Bytes, encoding); } if (responder != null) { try { - responder.Item3(e.RemoteEndPoint, encoding); + await responder.Item2.Item3(responder.Item1, e.RemoteEndPoint, encoding).ConfigureAwait(false); } catch (Exception ex) { @@ -93,8 +86,34 @@ namespace MediaBrowser.Server.Implementations.Udp } } - private async void RespondToV2Message(string endpoint, Encoding encoding) + private Tuple>> GetResponder(byte[] bytes, Encoding encoding) + { + var text = encoding.GetString(bytes); + var responder = _responders.FirstOrDefault(i => + { + if (i.Item2) + { + return text.IndexOf(i.Item1, StringComparison.OrdinalIgnoreCase) != -1; + } + return string.Equals(i.Item1, text, StringComparison.OrdinalIgnoreCase); + }); + + if (responder == null) + { + return null; + } + return new Tuple>>(text, responder); + } + + private async Task RespondToV2Message(string messageText, string endpoint, Encoding encoding) { + var parts = messageText.Split('|'); + + if (parts.Length > 1) + { + _appHost.EnableLoopback(parts[1]); + } + var localUrl = await _appHost.GetLocalApiUrl().ConfigureAwait(false); if (!string.IsNullOrEmpty(localUrl)) @@ -106,7 +125,7 @@ namespace MediaBrowser.Server.Implementations.Udp Name = _appHost.FriendlyName }; - await SendAsync(encoding.GetBytes(_json.SerializeToString(response)), endpoint); + await SendAsync(encoding.GetBytes(_json.SerializeToString(response)), endpoint).ConfigureAwait(false); } else { diff --git a/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs b/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs index faf3ba37e..2185f4804 100644 --- a/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs +++ b/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs @@ -278,6 +278,11 @@ namespace MediaBrowser.Server.Mono.Native return info; } + + public void EnableLoopback(string appName) + { + + } } public class NullPowerManagement : IPowerManagement diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 170719b0f..a25bd3812 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -1392,5 +1392,10 @@ namespace MediaBrowser.Server.Startup.Common { NativeApp.LaunchUrl(url); } + + public void EnableLoopback(string appName) + { + NativeApp.EnableLoopback(appName); + } } } diff --git a/MediaBrowser.Server.Startup.Common/INativeApp.cs b/MediaBrowser.Server.Startup.Common/INativeApp.cs index c13d3624e..d2e278a3b 100644 --- a/MediaBrowser.Server.Startup.Common/INativeApp.cs +++ b/MediaBrowser.Server.Startup.Common/INativeApp.cs @@ -107,5 +107,7 @@ namespace MediaBrowser.Server.Startup.Common void LaunchUrl(string url); IDbConnector GetDbConnector(); + + void EnableLoopback(string appName); } } diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index 67b2a3b47..8fb0e8f46 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -292,15 +292,6 @@ namespace MediaBrowser.ServerApplication ErrorModes.SEM_NOGPFAULTERRORBOX | ErrorModes.SEM_NOOPENFILEERRORBOX); } - try - { - LoopUtil.Run(); - } - catch (Exception ex) - { - logManager.GetLogger("LoopUtil").ErrorException("Error in LoopUtil", ex); - } - var task = _appHost.Init(initProgress); Task.WaitAll(task); diff --git a/MediaBrowser.ServerApplication/Native/LoopbackUtil.cs b/MediaBrowser.ServerApplication/Native/LoopbackUtil.cs index dea77d375..5b260685b 100644 --- a/MediaBrowser.ServerApplication/Native/LoopbackUtil.cs +++ b/MediaBrowser.ServerApplication/Native/LoopbackUtil.cs @@ -192,12 +192,12 @@ namespace MediaBrowser.ServerApplication.Native return hasChanges; } - public static void Run() + public static void Run(string appName) { var util = new LoopUtil(); util.LoadApps(); - var hasChanges = util.CreateExcemptions("Emby"); + var hasChanges = util.CreateExcemptions(appName); if (hasChanges) { diff --git a/MediaBrowser.ServerApplication/Native/WindowsApp.cs b/MediaBrowser.ServerApplication/Native/WindowsApp.cs index 3c9c04acb..139471f11 100644 --- a/MediaBrowser.ServerApplication/Native/WindowsApp.cs +++ b/MediaBrowser.ServerApplication/Native/WindowsApp.cs @@ -203,5 +203,10 @@ namespace MediaBrowser.ServerApplication.Native { ((Process)sender).Dispose(); } + + public void EnableLoopback(string appName) + { + LoopUtil.Run(appName); + } } } \ No newline at end of file diff --git a/MediaBrowser.sln b/MediaBrowser.sln index 90b318492..0b9dd90cd 100644 --- a/MediaBrowser.sln +++ b/MediaBrowser.sln @@ -65,6 +65,9 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.Drawing", "Emby.Drawing\Emby.Drawing.csproj", "{08FFF49B-F175-4807-A2B5-73B0EBD9F716}" EndProject Global + GlobalSection(Performance) = preSolution + HasPerformanceSessions = true + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index cfdfc7ef0..06159dadb 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.656 + 3.0.657 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains common components shared by Emby Theater and Emby Server. Not intended for plugin developer consumption. Copyright © Emby 2013 - + diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 1ebf4d052..de1af036d 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.656 + 3.0.657 MediaBrowser.Common Emby Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 630ff8fd2..d21fefc86 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.656 + 3.0.657 Media Browser.Server.Core Emby Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Emby Server. Copyright © Emby 2013 - + -- cgit v1.2.3 From 4e0adb17e74a252f3168070721854a03ecc9d07b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 7 Sep 2016 01:48:14 -0400 Subject: update dialogs --- MediaBrowser.Controller/Library/ILibraryManager.cs | 3 +++ .../Library/LibraryManager.cs | 31 +++++++++++++++++++++- .../LiveTv/EmbyTV/EmbyTV.cs | 2 ++ .../Migrations/UpdateLevelMigration.cs | 6 ----- 4 files changed, 35 insertions(+), 7 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Library') diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 0862e3eaf..04268bcea 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -566,5 +566,8 @@ namespace MediaBrowser.Controller.Library QueryResult> GetArtists(InternalItemsQuery query); QueryResult> GetAlbumArtists(InternalItemsQuery query); QueryResult> GetAllArtists(InternalItemsQuery query); + + void RegisterIgnoredPath(string path); + void UnRegisterIgnoredPath(string path); } } \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 5d556e3a6..7758d690a 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -621,9 +621,38 @@ namespace MediaBrowser.Server.Implementations.Library return ResolveItem(args, resolvers); } + private readonly List _ignoredPaths = new List(); + + public void RegisterIgnoredPath(string path) + { + lock (_ignoredPaths) + { + _ignoredPaths.Add(path); + } + } + public void UnRegisterIgnoredPath(string path) + { + lock (_ignoredPaths) + { + _ignoredPaths.Remove(path); + } + } + public bool IgnoreFile(FileSystemMetadata file, BaseItem parent) { - return EntityResolutionIgnoreRules.Any(r => r.ShouldIgnore(file, parent)); + if (EntityResolutionIgnoreRules.Any(r => r.ShouldIgnore(file, parent))) + { + return true; + } + + //lock (_ignoredPaths) + { + if (_ignoredPaths.Contains(file.FullName, StringComparer.OrdinalIgnoreCase)) + { + return true; + } + } + return false; } public IEnumerable NormalizeRootPathList(IEnumerable paths) diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 8f5b42df0..8fa34109d 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -993,6 +993,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV recordPath = recorder.GetOutputPath(mediaStreamInfo, recordPath); recordPath = EnsureFileUnique(recordPath, timer.Id); + _libraryManager.RegisterIgnoredPath(recordPath); _libraryMonitor.ReportFileSystemChangeBeginning(recordPath); _fileSystem.CreateDirectory(Path.GetDirectoryName(recordPath)); activeRecordingInfo.Path = recordPath; @@ -1044,6 +1045,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV semaphore.Release(); } + _libraryManager.UnRegisterIgnoredPath(recordPath); _libraryMonitor.ReportFileSystemChangeComplete(recordPath, true); ActiveRecordingInfo removed; diff --git a/MediaBrowser.Server.Startup.Common/Migrations/UpdateLevelMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/UpdateLevelMigration.cs index de898e66c..d5fe9707c 100644 --- a/MediaBrowser.Server.Startup.Common/Migrations/UpdateLevelMigration.cs +++ b/MediaBrowser.Server.Startup.Common/Migrations/UpdateLevelMigration.cs @@ -42,12 +42,6 @@ namespace MediaBrowser.Server.Startup.Common.Migrations { var updateLevel = _config.Configuration.SystemUpdateLevel; - if (updateLevel == PackageVersionClass.Dev) - { - // It's already dev, there's nothing to check - return; - } - await CheckVersion(currentVersion, updateLevel, CancellationToken.None).ConfigureAwait(false); } catch -- cgit v1.2.3 From d68a8268331ab2c3f75b1f3edd8b786e48b0ba57 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 7 Sep 2016 13:17:26 -0400 Subject: update dialogs --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 10 +++++++--- MediaBrowser.Controller/Entities/Folder.cs | 12 +++++++++++- MediaBrowser.Dlna/PlayTo/Device.cs | 2 ++ .../Library/LibraryManager.cs | 2 +- MediaBrowser.Server.Startup.Common/ApplicationHost.cs | 8 +++++--- 5 files changed, 26 insertions(+), 8 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Library') diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index a979848e2..5d7f01ad3 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1176,17 +1176,21 @@ namespace MediaBrowser.Api.Playback await Task.Delay(100, cancellationTokenSource.Token).ConfigureAwait(false); } - if (state.IsInputVideo && transcodingJob.Type == TranscodingJobType.Progressive) + if (state.IsInputVideo && transcodingJob.Type == TranscodingJobType.Progressive && !transcodingJob.HasExited) { await Task.Delay(1000, cancellationTokenSource.Token).ConfigureAwait(false); - if (state.ReadInputAtNativeFramerate) + if (state.ReadInputAtNativeFramerate && !transcodingJob.HasExited) { await Task.Delay(1500, cancellationTokenSource.Token).ConfigureAwait(false); } } - StartThrottler(state, transcodingJob); + if (!transcodingJob.HasExited) + { + StartThrottler(state, transcodingJob); + } + ReportUsage(state); return transcodingJob; diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index bf47ada0d..f1d8def4b 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -1057,10 +1057,20 @@ namespace MediaBrowser.Controller.Entities /// IList{BaseItem}. public IList GetRecursiveChildren() { - return GetRecursiveChildren(i => true); + return GetRecursiveChildren(true); + } + + public IList GetRecursiveChildren(bool includeLinkedChildren) + { + return GetRecursiveChildren(i => true, includeLinkedChildren); } public IList GetRecursiveChildren(Func filter) + { + return GetRecursiveChildren(filter, true); + } + + public IList GetRecursiveChildren(Func filter, bool includeLinkedChildren) { var result = new Dictionary(); diff --git a/MediaBrowser.Dlna/PlayTo/Device.cs b/MediaBrowser.Dlna/PlayTo/Device.cs index 174ca871a..d1802b3ad 100644 --- a/MediaBrowser.Dlna/PlayTo/Device.cs +++ b/MediaBrowser.Dlna/PlayTo/Device.cs @@ -483,7 +483,9 @@ namespace MediaBrowser.Dlna.PlayTo { if (OnDeviceUnavailable != null) { + _logger.Debug("Disposing device due to loss of connection"); OnDeviceUnavailable(); + return; } } if (_successiveStopCount >= maxSuccessiveStopReturns) diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 7758d690a..442e2ebe5 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -401,7 +401,7 @@ namespace MediaBrowser.Server.Implementations.Library var locationType = item.LocationType; var children = item.IsFolder - ? ((Folder)item).GetRecursiveChildren().ToList() + ? ((Folder)item).GetRecursiveChildren(false).ToList() : new List(); foreach (var metadataPath in GetMetadataPaths(item, children)) diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 2417c5b11..07659fdfc 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -363,7 +363,10 @@ namespace MediaBrowser.Server.Startup.Common private void PerformPreInitMigrations() { - var migrations = new List(); + var migrations = new List + { + new UpdateLevelMigration(ServerConfigurationManager, this, HttpClient, JsonSerializer, _releaseAssetFilename) + }; foreach (var task in migrations) { @@ -383,8 +386,7 @@ namespace MediaBrowser.Server.Startup.Common var migrations = new List { new MovieDbEpisodeProviderMigration(ServerConfigurationManager), - new DbMigration(ServerConfigurationManager, TaskManager), - new UpdateLevelMigration(ServerConfigurationManager, this, HttpClient, JsonSerializer, _releaseAssetFilename) + new DbMigration(ServerConfigurationManager, TaskManager) }; foreach (var task in migrations) -- cgit v1.2.3