From 15947c2a4cd1588b30d6932eea5be0f41951af5b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 2 Jul 2017 14:58:56 -0400 Subject: update opening of live streams --- MediaBrowser.Controller/Library/IMediaSourceProvider.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs index b0881ba7c..4ec9adf4e 100644 --- a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs +++ b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs @@ -20,10 +20,7 @@ namespace MediaBrowser.Controller.Library /// /// Opens the media source. /// - /// The open token. - /// The cancellation token. - /// Task<MediaSourceInfo>. - Task> OpenMediaSource(string openToken, CancellationToken cancellationToken); + Task> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken); /// /// Closes the media source. -- cgit v1.2.3 From 07ab6a19e25b722513cf4731427ca04a08c6cb86 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 10 Jul 2017 03:37:00 -0400 Subject: 3.2.24.1 --- Emby.Common.Implementations/BaseApplicationHost.cs | 21 ++++++++++++++++----- .../Localization/Ratings/es.txt | 5 +++++ MediaBrowser.Controller/Entities/Video.cs | 16 ++++++++++++++++ MediaBrowser.Model/Sync/SyncJob.cs | 5 ++++- .../TV/TheMovieDb/MovieDbEpisodeProvider.cs | 2 -- SharedVersion.cs | 2 +- 6 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 Emby.Server.Implementations/Localization/Ratings/es.txt (limited to 'MediaBrowser.Controller') diff --git a/Emby.Common.Implementations/BaseApplicationHost.cs b/Emby.Common.Implementations/BaseApplicationHost.cs index d16afbce3..847eeca64 100644 --- a/Emby.Common.Implementations/BaseApplicationHost.cs +++ b/Emby.Common.Implementations/BaseApplicationHost.cs @@ -169,14 +169,15 @@ namespace Emby.Common.Implementations { _deviceId = new DeviceId(ApplicationPaths, LogManager.GetLogger("SystemId"), FileSystemManager); } - + return _deviceId.Value; } } public PackageVersionClass SystemUpdateLevel { - get { + get + { #if BETA return PackageVersionClass.Beta; @@ -216,7 +217,7 @@ namespace Emby.Common.Implementations // hack alert, until common can target .net core BaseExtensions.CryptographyProvider = CryptographyProvider; - + XmlSerializer = new MyXmlSerializer(fileSystem, logManager.GetLogger("XmlSerializer")); FailedAssemblies = new List(); @@ -565,7 +566,10 @@ namespace Emby.Common.Implementations try { - return assembly.GetTypes(); + // This null checking really shouldn't be needed but adding it due to some + // unhandled exceptions in mono 5.0 that are a little hard to hunt down + var types = assembly.GetTypes() ?? new Type[] { }; + return types.Where(t => t != null); } catch (ReflectionTypeLoadException ex) { @@ -578,7 +582,14 @@ namespace Emby.Common.Implementations } // If it fails we can still get a list of the Types it was able to resolve - return ex.Types.Where(t => t != null); + var types = ex.Types ?? new Type[] { }; + return types.Where(t => t != null); + } + catch (Exception ex) + { + Logger.ErrorException("Error loading types from assembly", ex); + + return new List(); } } diff --git a/Emby.Server.Implementations/Localization/Ratings/es.txt b/Emby.Server.Implementations/Localization/Ratings/es.txt new file mode 100644 index 000000000..1ba24fb99 --- /dev/null +++ b/Emby.Server.Implementations/Localization/Ratings/es.txt @@ -0,0 +1,5 @@ +ES-A,1 +ES-7,3 +ES-12,6 +ES-16,8 +ES-18,11 \ No newline at end of file diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index 7978f4761..c5d9b9203 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -57,6 +57,22 @@ namespace MediaBrowser.Controller.Entities { get { + var extraType = ExtraType; + if (extraType.HasValue) + { + if (extraType.Value == Model.Entities.ExtraType.Sample) + { + return false; + } + if (extraType.Value == Model.Entities.ExtraType.ThemeVideo) + { + return false; + } + if (extraType.Value == Model.Entities.ExtraType.Trailer) + { + return false; + } + } return true; } } diff --git a/MediaBrowser.Model/Sync/SyncJob.cs b/MediaBrowser.Model/Sync/SyncJob.cs index 6709426b8..f0e262c50 100644 --- a/MediaBrowser.Model/Sync/SyncJob.cs +++ b/MediaBrowser.Model/Sync/SyncJob.cs @@ -59,7 +59,7 @@ namespace MediaBrowser.Model.Sync /// Gets or sets the status. /// /// The status. - public SyncJobStatus Status { get; set; } + public SyncJobStatus Status { get; set; } /// /// Gets or sets the user identifier. /// @@ -105,9 +105,12 @@ namespace MediaBrowser.Model.Sync public string PrimaryImageItemId { get; set; } public string PrimaryImageTag { get; set; } + public bool EnableAutomaticResync { get; set; } + public SyncJob() { RequestedItemIds = new List(); + EnableAutomaticResync = true; } } } diff --git a/MediaBrowser.Providers/TV/TheMovieDb/MovieDbEpisodeProvider.cs b/MediaBrowser.Providers/TV/TheMovieDb/MovieDbEpisodeProvider.cs index 2e549f610..618a4df45 100644 --- a/MediaBrowser.Providers/TV/TheMovieDb/MovieDbEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/TheMovieDb/MovieDbEpisodeProvider.cs @@ -196,8 +196,6 @@ namespace MediaBrowser.Providers.TV } catch (HttpException ex) { - Logger.Error("No metadata found for {0}", seasonNumber.Value); - if (ex.StatusCode.HasValue && ex.StatusCode.Value == HttpStatusCode.NotFound) { return result; diff --git a/SharedVersion.cs b/SharedVersion.cs index 0e07c788d..42b8a9abb 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.23.1")] +[assembly: AssemblyVersion("3.2.24.1")] -- cgit v1.2.3 From b8d4ef5fc6a1d042c8521265b50ef60eaa492e68 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 12 Jul 2017 14:54:46 -0400 Subject: add session reporting error handling --- MediaBrowser.Api/Playback/Hls/VideoHlsService.cs | 10 ++++++++++ MediaBrowser.Controller/Session/SessionInfo.cs | 14 ++++++++++++++ SharedVersion.cs | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index e32970be5..d11e6f215 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -75,6 +75,16 @@ namespace MediaBrowser.Api.Playback.Hls /// System.String. protected override string GetVideoArguments(StreamState state) { + if (!state.IsOutputVideo) + { + return string.Empty; + } + // No known video stream + if (state.VideoStream == null) + { + return string.Empty; + } + var codec = EncodingHelper.GetVideoEncoder(state, ApiEntryPoint.Instance.GetEncodingOptions()); var args = "-codec:v:0 " + codec; diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index f590d9aec..11a9ceac4 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -203,6 +203,11 @@ namespace MediaBrowser.Controller.Session public void StartAutomaticProgress(ITimerFactory timerFactory, PlaybackProgressInfo progressInfo) { + if (_disposed) + { + return; + } + lock (_progressLock) { _lastProgressInfo = progressInfo; @@ -223,6 +228,11 @@ namespace MediaBrowser.Controller.Session private async void OnProgressTimerCallback(object state) { + if (_disposed) + { + return; + } + var progressInfo = _lastProgressInfo; if (progressInfo == null) { @@ -274,8 +284,12 @@ namespace MediaBrowser.Controller.Session } } + private bool _disposed = false; + public void Dispose() { + _disposed = true; + StopAutomaticProgress(); _sessionManager = null; } diff --git a/SharedVersion.cs b/SharedVersion.cs index 42b8a9abb..82630841c 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.24.1")] +[assembly: AssemblyVersion("3.2.25.2")] -- cgit v1.2.3 From bd32c8ba499905eee7a492012789bd0d86022876 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 13 Jul 2017 15:04:59 -0400 Subject: update lg dlna profile --- Emby.Dlna/Profiles/LgTvProfile.cs | 9 +-------- Emby.Dlna/Profiles/Xml/LG Smart TV.xml | 3 +-- MediaBrowser.Controller/Channels/ChannelMediaInfo.cs | 2 +- MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/Emby.Dlna/Profiles/LgTvProfile.cs b/Emby.Dlna/Profiles/LgTvProfile.cs index 71f684ec4..f81fb1ee7 100644 --- a/Emby.Dlna/Profiles/LgTvProfile.cs +++ b/Emby.Dlna/Profiles/LgTvProfile.cs @@ -53,14 +53,7 @@ namespace Emby.Dlna.Profiles { new DirectPlayProfile { - Container = "ts", - VideoCodec = "h264", - AudioCodec = "aac,ac3,mp3,dca,dts", - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Container = "mkv", + Container = "ts,mpegts,avi,mkv", VideoCodec = "h264", AudioCodec = "aac,ac3,mp3,dca,dts", Type = DlnaProfileType.Video diff --git a/Emby.Dlna/Profiles/Xml/LG Smart TV.xml b/Emby.Dlna/Profiles/Xml/LG Smart TV.xml index a61fefcc8..92e02799e 100644 --- a/Emby.Dlna/Profiles/Xml/LG Smart TV.xml +++ b/Emby.Dlna/Profiles/Xml/LG Smart TV.xml @@ -35,8 +35,7 @@ false - - + diff --git a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs index ba20395d1..cf7b6ba6a 100644 --- a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs +++ b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs @@ -67,7 +67,7 @@ namespace MediaBrowser.Controller.Channels Name = id, Id = id, ReadAtNativeFramerate = ReadAtNativeFramerate, - SupportsDirectStream = false, + SupportsDirectStream = Protocol == MediaProtocol.Http && !string.IsNullOrWhiteSpace(Container) && !string.Equals(Container, "hls", StringComparison.OrdinalIgnoreCase), SupportsDirectPlay = SupportsDirectPlay, IsRemote = true }; diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index faf5b0667..f1bf29d92 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -733,9 +733,9 @@ namespace MediaBrowser.MediaEncoding.Encoder var mapArg = imageStreamIndex.HasValue ? (" -map 0:v:" + imageStreamIndex.Value.ToString(CultureInfo.InvariantCulture)) : string.Empty; var enableThumbnail = !new List { "wtv" }.Contains(container ?? string.Empty, StringComparer.OrdinalIgnoreCase); + // Use ffmpeg to sample 100 (we can drop this if required using thumbnail=50 for 50 frames) frames and pick the best thumbnail. Have a fall back just in case. var thumbnail = enableThumbnail ? ",thumbnail=24" : string.Empty; - // Use ffmpeg to sample 100 (we can drop this if required using thumbnail=50 for 50 frames) frames and pick the best thumbnail. Have a fall back just in case. var args = useIFrame ? string.Format("-i {0}{3} -threads 0 -v quiet -vframes 1 -vf \"{2}{4}\" -f image2 \"{1}\"", inputPath, tempExtractPath, vf, mapArg, thumbnail) : string.Format("-i {0}{3} -threads 0 -v quiet -vframes 1 -vf \"{2}\" -f image2 \"{1}\"", inputPath, tempExtractPath, vf, mapArg); -- cgit v1.2.3 From cdf573c92160e85550ed39af2dcddb500064ddd2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 15 Jul 2017 16:19:58 -0400 Subject: update sync menus --- .../LiveTv/TunerHosts/M3UTunerHost.cs | 4 +++- .../ScheduledTasks/SystemUpdateTask.cs | 12 +----------- MediaBrowser.Api/Images/ImageService.cs | 5 ++++- MediaBrowser.Controller/Sync/ISyncManager.cs | 2 ++ MediaBrowser.Controller/Sync/ISyncProvider.cs | 4 +++- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 ++-- SharedVersion.cs | 2 +- 8 files changed, 17 insertions(+), 18 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs index af4c7f3e7..113cb33f4 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs @@ -151,7 +151,9 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts Id = channel.Path.GetMD5().ToString("N"), IsInfiniteStream = true, - IsRemote = true + IsRemote = true, + + IgnoreDts = true }; mediaSource.InferTotalBitrate(); diff --git a/Emby.Server.Implementations/ScheduledTasks/SystemUpdateTask.cs b/Emby.Server.Implementations/ScheduledTasks/SystemUpdateTask.cs index 52bd0a504..0c9eb0f1b 100644 --- a/Emby.Server.Implementations/ScheduledTasks/SystemUpdateTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/SystemUpdateTask.cs @@ -71,8 +71,6 @@ namespace Emby.Server.Implementations.ScheduledTasks // Create a progress object for the update check var updateInfo = await _appHost.CheckForApplicationUpdate(cancellationToken, new SimpleProgress()).ConfigureAwait(false); - progress.Report(10); - if (!updateInfo.IsUpdateAvailable) { Logger.Debug("No application update available."); @@ -87,15 +85,7 @@ namespace Emby.Server.Implementations.ScheduledTasks { Logger.Info("Update Revision {0} available. Updating...", updateInfo.AvailableVersion); - EventHandler innerProgressHandler = (sender, e) => progress.Report(e * .9 + .1); - - var innerProgress = new SimpleProgress(); - innerProgress.ProgressChanged += innerProgressHandler; - - await _appHost.UpdateApplication(updateInfo.Package, cancellationToken, innerProgress).ConfigureAwait(false); - - // Release the event handler - innerProgress.ProgressChanged -= innerProgressHandler; + await _appHost.UpdateApplication(updateInfo.Package, cancellationToken, progress).ConfigureAwait(false); } else { diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 221755916..f6c97e091 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -17,6 +17,7 @@ using System.Threading.Tasks; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.IO; +using MediaBrowser.Controller.LiveTv; using MediaBrowser.Model.IO; using MediaBrowser.Model.Services; @@ -567,7 +568,9 @@ namespace MediaBrowser.Api.Images }).ToList() : new List(); - var cropwhitespace = request.Type == ImageType.Logo || request.Type == ImageType.Art; + var cropwhitespace = request.Type == ImageType.Logo || + request.Type == ImageType.Art + || (request.Type == ImageType.Primary && item is LiveTvChannel); if (request.CropWhitespace.HasValue) { diff --git a/MediaBrowser.Controller/Sync/ISyncManager.cs b/MediaBrowser.Controller/Sync/ISyncManager.cs index fbcb549ad..291632ea5 100644 --- a/MediaBrowser.Controller/Sync/ISyncManager.cs +++ b/MediaBrowser.Controller/Sync/ISyncManager.cs @@ -90,6 +90,8 @@ namespace MediaBrowser.Controller.Sync /// IEnumerable GetSyncTargets(string userId); + IEnumerable GetSyncTargets(string userId, bool? supportsRemoteSync); + /// /// Supportses the synchronize. /// diff --git a/MediaBrowser.Controller/Sync/ISyncProvider.cs b/MediaBrowser.Controller/Sync/ISyncProvider.cs index ef34bfe69..aa4b36427 100644 --- a/MediaBrowser.Controller/Sync/ISyncProvider.cs +++ b/MediaBrowser.Controller/Sync/ISyncProvider.cs @@ -11,6 +11,8 @@ namespace MediaBrowser.Controller.Sync /// The name. string Name { get; } + bool SupportsRemoteSync { get; } + /// /// Gets the synchronize targets. /// @@ -27,6 +29,6 @@ namespace MediaBrowser.Controller.Sync public interface IHasUniqueTargetIds { - + } } diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index cb4d372a5..660961a34 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.705 + 3.0.707 Emby.Common Emby Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 76846b98c..9b80ba0ab 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.705 + 3.0.707 Emby.Server.Core Emby Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Emby Server. Copyright © Emby 2013 - + diff --git a/SharedVersion.cs b/SharedVersion.cs index a12afc2e9..a64c002ce 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.25.4")] +[assembly: AssemblyVersion("3.2.25.5")] -- cgit v1.2.3 From d826b9844952d677e9a8aba730fe85013a78c6f6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 20 Jul 2017 16:37:13 -0400 Subject: 3.2.25.10 --- Emby.Dlna/Eventing/EventManager.cs | 60 ++++++++++++++++++--------- Emby.Dlna/Service/BaseService.cs | 8 ++-- MediaBrowser.Api/Dlna/DlnaServerService.cs | 33 ++++----------- MediaBrowser.Controller/Dlna/IEventManager.cs | 11 +---- SharedVersion.cs | 2 +- 5 files changed, 54 insertions(+), 60 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/Emby.Dlna/Eventing/EventManager.cs b/Emby.Dlna/Eventing/EventManager.cs index cf2c8d995..0516585ae 100644 --- a/Emby.Dlna/Eventing/EventManager.cs +++ b/Emby.Dlna/Eventing/EventManager.cs @@ -26,32 +26,34 @@ namespace Emby.Dlna.Eventing _logger = logger; } - public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, int? timeoutSeconds) + public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string requestedTimeoutString) { - var timeout = timeoutSeconds ?? 300; - var subscription = GetSubscription(subscriptionId, true); - _logger.Debug("Renewing event subscription for {0} with timeout of {1} to {2}", - subscription.NotificationType, - timeout, - subscription.CallbackUrl); + // Remove logging for now because some devices are sending this very frequently + // TODO re-enable with dlna debug logging setting + //_logger.Debug("Renewing event subscription for {0} with timeout of {1} to {2}", + // subscription.NotificationType, + // timeout, + // subscription.CallbackUrl); - subscription.TimeoutSeconds = timeout; + subscription.TimeoutSeconds = ParseTimeout(requestedTimeoutString) ?? 300; subscription.SubscriptionTime = DateTime.UtcNow; - return GetEventSubscriptionResponse(subscriptionId, timeout); + return GetEventSubscriptionResponse(subscriptionId, requestedTimeoutString, subscription.TimeoutSeconds); } - public EventSubscriptionResponse CreateEventSubscription(string notificationType, int? timeoutSeconds, string callbackUrl) + public EventSubscriptionResponse CreateEventSubscription(string notificationType, string requestedTimeoutString, string callbackUrl) { - var timeout = timeoutSeconds ?? 300; + var timeout = ParseTimeout(requestedTimeoutString) ?? 300; var id = "uuid:" + Guid.NewGuid().ToString("N"); - _logger.Debug("Creating event subscription for {0} with timeout of {1} to {2}", - notificationType, - timeout, - callbackUrl); + // Remove logging for now because some devices are sending this very frequently + // TODO re-enable with dlna debug logging setting + //_logger.Debug("Creating event subscription for {0} with timeout of {1} to {2}", + // notificationType, + // timeout, + // callbackUrl); _subscriptions.TryAdd(id, new EventSubscription { @@ -61,7 +63,25 @@ namespace Emby.Dlna.Eventing TimeoutSeconds = timeout }); - return GetEventSubscriptionResponse(id, timeout); + return GetEventSubscriptionResponse(id, requestedTimeoutString, timeout); + } + + private int? ParseTimeout(string header) + { + if (!string.IsNullOrEmpty(header)) + { + // Starts with SECOND- + header = header.Split('-').Last(); + + int val; + + if (int.TryParse(header, NumberStyles.Any, _usCulture, out val)) + { + return val; + } + } + + return null; } public EventSubscriptionResponse CancelEventSubscription(string subscriptionId) @@ -73,22 +93,22 @@ namespace Emby.Dlna.Eventing return new EventSubscriptionResponse { - Content = "\r\n", + Content = string.Empty, ContentType = "text/plain" }; } private readonly CultureInfo _usCulture = new CultureInfo("en-US"); - private EventSubscriptionResponse GetEventSubscriptionResponse(string subscriptionId, int timeoutSeconds) + private EventSubscriptionResponse GetEventSubscriptionResponse(string subscriptionId, string requestedTimeoutString, int timeoutSeconds) { var response = new EventSubscriptionResponse { - Content = "\r\n", + Content = string.Empty, ContentType = "text/plain" }; response.Headers["SID"] = subscriptionId; - response.Headers["TIMEOUT"] = "SECOND-" + timeoutSeconds.ToString(_usCulture); + response.Headers["TIMEOUT"] = string.IsNullOrWhiteSpace(requestedTimeoutString) ? ("SECOND-" + timeoutSeconds.ToString(_usCulture)) : requestedTimeoutString; return response; } diff --git a/Emby.Dlna/Service/BaseService.cs b/Emby.Dlna/Service/BaseService.cs index 574d74958..ddc37da09 100644 --- a/Emby.Dlna/Service/BaseService.cs +++ b/Emby.Dlna/Service/BaseService.cs @@ -24,14 +24,14 @@ namespace Emby.Dlna.Service return EventManager.CancelEventSubscription(subscriptionId); } - public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, int? timeoutSeconds) + public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string timeoutString) { - return EventManager.RenewEventSubscription(subscriptionId, timeoutSeconds); + return EventManager.RenewEventSubscription(subscriptionId, timeoutString); } - public EventSubscriptionResponse CreateEventSubscription(string notificationType, int? timeoutSeconds, string callbackUrl) + public EventSubscriptionResponse CreateEventSubscription(string notificationType, string timeoutString, string callbackUrl) { - return EventManager.CreateEventSubscription(notificationType, timeoutSeconds, callbackUrl); + return EventManager.CreateEventSubscription(notificationType, timeoutString, callbackUrl); } } } diff --git a/MediaBrowser.Api/Dlna/DlnaServerService.cs b/MediaBrowser.Api/Dlna/DlnaServerService.cs index 6e59cceec..fc8c0edf6 100644 --- a/MediaBrowser.Api/Dlna/DlnaServerService.cs +++ b/MediaBrowser.Api/Dlna/DlnaServerService.cs @@ -219,20 +219,20 @@ namespace MediaBrowser.Api.Dlna private object ProcessEventRequest(IEventManager eventManager) { var subscriptionId = GetHeader("SID"); - var notificationType = GetHeader("NT"); - var callback = GetHeader("CALLBACK"); - var timeoutString = GetHeader("TIMEOUT"); - - var timeout = ParseTimeout(timeoutString); if (string.Equals(Request.Verb, "SUBSCRIBE", StringComparison.OrdinalIgnoreCase)) { + var notificationType = GetHeader("NT"); + + var callback = GetHeader("CALLBACK"); + var timeoutString = GetHeader("TIMEOUT"); + if (string.IsNullOrEmpty(notificationType)) { - return GetSubscriptionResponse(eventManager.RenewEventSubscription(subscriptionId, timeout)); + return GetSubscriptionResponse(eventManager.RenewEventSubscription(subscriptionId, timeoutString)); } - return GetSubscriptionResponse(eventManager.CreateEventSubscription(notificationType, timeout, callback)); + return GetSubscriptionResponse(eventManager.CreateEventSubscription(notificationType, timeoutString, callback)); } return GetSubscriptionResponse(eventManager.CancelEventSubscription(subscriptionId)); @@ -242,24 +242,5 @@ namespace MediaBrowser.Api.Dlna { return ResultFactory.GetResult(response.Content, response.ContentType, response.Headers); } - - private readonly CultureInfo _usCulture = new CultureInfo("en-US"); - private int? ParseTimeout(string header) - { - if (!string.IsNullOrEmpty(header)) - { - // Starts with SECOND- - header = header.Split('-').Last(); - - int val; - - if (int.TryParse(header, NumberStyles.Any, _usCulture, out val)) - { - return val; - } - } - - return null; - } } } diff --git a/MediaBrowser.Controller/Dlna/IEventManager.cs b/MediaBrowser.Controller/Dlna/IEventManager.cs index 54e2a02dd..8c91bd889 100644 --- a/MediaBrowser.Controller/Dlna/IEventManager.cs +++ b/MediaBrowser.Controller/Dlna/IEventManager.cs @@ -12,18 +12,11 @@ namespace MediaBrowser.Controller.Dlna /// /// Renews the event subscription. /// - /// The subscription identifier. - /// The timeout seconds. - /// EventSubscriptionResponse. - EventSubscriptionResponse RenewEventSubscription(string subscriptionId, int? timeoutSeconds); + EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string requestedTimeoutString); /// /// Creates the event subscription. /// - /// Type of the notification. - /// The timeout seconds. - /// The callback URL. - /// EventSubscriptionResponse. - EventSubscriptionResponse CreateEventSubscription(string notificationType, int? timeoutSeconds, string callbackUrl); + EventSubscriptionResponse CreateEventSubscription(string notificationType, string requestedTimeoutString, string callbackUrl); } } diff --git a/SharedVersion.cs b/SharedVersion.cs index df89e08a2..7fed66523 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.25.9")] +[assembly: AssemblyVersion("3.2.25.10")] -- cgit v1.2.3 From 401d82eea7e2313e231330402b5f870d8827b752 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 21 Jul 2017 15:05:52 -0400 Subject: fixes #2559 - movie.nfo being ignored --- MediaBrowser.Controller/Providers/DirectoryService.cs | 6 +++++- MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs index 3d1af2afa..6d220f3a3 100644 --- a/MediaBrowser.Controller/Providers/DirectoryService.cs +++ b/MediaBrowser.Controller/Providers/DirectoryService.cs @@ -120,10 +120,14 @@ namespace MediaBrowser.Controller.Providers { file = _fileSystem.GetFileInfo(path); - if (file != null) + if (file != null && file.Exists) { _fileCache.TryAdd(path, file); } + else + { + return null; + } } return file; diff --git a/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs index f32f89bc2..aea3f2c70 100644 --- a/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs +++ b/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs @@ -51,6 +51,11 @@ namespace MediaBrowser.XbmcMetadata.Savers //} list.Add(Path.ChangeExtension(item.Path, ".nfo")); + + if (!item.IsInMixedFolder) + { + list.Add(Path.Combine(item.ContainingFolderPath, "movie.nfo")); + } } return list; -- cgit v1.2.3