From c94cd9ac7475f328e3bae92a414447a9f12cf085 Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 1 Dec 2015 22:57:40 -0500 Subject: [PATCH 1/5] update mac project --- MediaBrowser.Server.Mac/Emby.Server.Mac.csproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj index 62c2386f0..9fdb528dd 100644 --- a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj +++ b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj @@ -4855,6 +4855,9 @@ Resources\dashboard-ui\strings\javascript\kk.json + + Resources\dashboard-ui\strings\javascript\ko.json + Resources\dashboard-ui\strings\javascript\ms.json @@ -4924,6 +4927,9 @@ Resources\dashboard-ui\thirdparty\headroom.js + + Resources\dashboard-ui\thirdparty\hls.min.js + Resources\dashboard-ui\thirdparty\jquery.unveil-custom.js From 4deb3017c3a881b60f3b26704bfbef683bdec29e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 2 Dec 2015 23:31:58 -0500 Subject: [PATCH 2/5] add cache file deletion error handling --- .../Logging/NlogManager.cs | 2 +- .../ScheduledTasks/Tasks/DeleteCacheFileTask.cs | 17 ++++++++++++++++- .../Security/PluginSecurityManager.cs | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Common.Implementations/Logging/NlogManager.cs b/MediaBrowser.Common.Implementations/Logging/NlogManager.cs index 391e7c212..1bbcccd88 100644 --- a/MediaBrowser.Common.Implementations/Logging/NlogManager.cs +++ b/MediaBrowser.Common.Implementations/Logging/NlogManager.cs @@ -110,7 +110,7 @@ namespace MediaBrowser.Common.Implementations.Logging var logFile = new FileTarget { FileName = path, - Layout = "${longdate} ${level} - ${logger}: ${message}" + Layout = "${longdate} ${level} ${logger}: ${message}" }; logFile.Name = "ApplicationLogFile"; diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs index 0e50f9315..c7423a775 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs @@ -128,7 +128,18 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks DeleteEmptyFolders(directory); if (!_fileSystem.GetFileSystemEntryPaths(directory).Any()) { - _fileSystem.DeleteDirectory(directory, false); + try + { + _fileSystem.DeleteDirectory(directory, false); + } + catch (UnauthorizedAccessException ex) + { + _logger.ErrorException("Error deleting directory {0}", ex, directory); + } + catch (IOException ex) + { + _logger.ErrorException("Error deleting directory {0}", ex, directory); + } } } } @@ -139,6 +150,10 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks { _fileSystem.DeleteFile(path); } + catch (UnauthorizedAccessException ex) + { + _logger.ErrorException("Error deleting file {0}", ex, path); + } catch (IOException ex) { _logger.ErrorException("Error deleting file {0}", ex, path); diff --git a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs index d4fa74a86..e796dba76 100644 --- a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs +++ b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs @@ -21,7 +21,7 @@ namespace MediaBrowser.Common.Implementations.Security public class PluginSecurityManager : ISecurityManager { private const string MBValidateUrl = MbAdmin.HttpsUrl + "service/registration/validate"; - private const string AppstoreRegUrl = /*MbAdmin.HttpsUrl*/ "http://mb3admin.com/admin/" + "service/appstore/register"; + private const string AppstoreRegUrl = /*MbAdmin.HttpsUrl*/ "http://mb3admin.com/admin/service/appstore/register"; /// /// The _is MB supporter From c750e84e804c26f7b1738b7e253f8ef2f216b695 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 2 Dec 2015 23:32:09 -0500 Subject: [PATCH 3/5] update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f10556ee7..6ee0855b7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ It features a REST-based api with built-in documention to facilitate client deve ## Emby Apps - [Android Mobile (Play Store)](https://play.google.com/store/apps/details?id=com.mb.android "Android Mobile (Play Store)") -- [Android Mobile (Amazon)](http://www.amazon.com/Emby-Mobile/dp/B017OSA1QS "Android Mobile (Amazon)") +- [Android Mobile (Amazon)](http://www.amazon.com/Emby-for-Android/dp/B00GVH9O0I "Android Mobile (Amazon)") - [Android TV](https://play.google.com/store/apps/details?id=tv.emby.embyatv "Android TV") - [Amazon Fire TV](http://www.amazon.com/Emby-for-Fire-TV/dp/B00VVJKTW8 "Amazon Fire TV") - [HTML5](http://app.emby.media "HTML5") From 91ccbd95fcfe6a7bb48082e28cfe72498a54df9f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 2 Dec 2015 23:33:25 -0500 Subject: [PATCH 4/5] add error handling when parsing bitrate --- MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index ddcd48b8b..d4df19af2 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -49,7 +49,11 @@ namespace MediaBrowser.MediaEncoding.Probing if (!string.IsNullOrEmpty(data.format.bit_rate)) { - info.Bitrate = int.Parse(data.format.bit_rate, _usCulture); + int value; + if (int.TryParse(data.format.bit_rate, NumberStyles.Any, _usCulture, out value)) + { + info.Bitrate = value; + } } } From b9638b484ddc27de3c554ad622f1bdbdc97541de Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 2 Dec 2015 23:38:16 -0500 Subject: [PATCH 5/5] update interval task trigger --- .../ScheduledTasks/IntervalTrigger.cs | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/MediaBrowser.Common/ScheduledTasks/IntervalTrigger.cs b/MediaBrowser.Common/ScheduledTasks/IntervalTrigger.cs index a12fea14c..e07dfcceb 100644 --- a/MediaBrowser.Common/ScheduledTasks/IntervalTrigger.cs +++ b/MediaBrowser.Common/ScheduledTasks/IntervalTrigger.cs @@ -1,6 +1,7 @@ using MediaBrowser.Model.Events; using MediaBrowser.Model.Tasks; using System; +using System.Linq; using System.Threading; namespace MediaBrowser.Common.ScheduledTasks @@ -30,16 +31,7 @@ namespace MediaBrowser.Common.ScheduledTasks /// public TaskExecutionOptions TaskOptions { get; set; } - /// - /// Gets or sets the first run delay. - /// - /// The first run delay. - public TimeSpan FirstRunDelay { get; set; } - - public IntervalTrigger() - { - FirstRunDelay = TimeSpan.FromHours(1); - } + private DateTime _lastStartDate; /// /// Stars waiting for the trigger action @@ -50,20 +42,21 @@ namespace MediaBrowser.Common.ScheduledTasks { DisposeTimer(); - var triggerDate = lastResult != null ? - lastResult.EndTimeUtc.Add(Interval) : - DateTime.UtcNow.Add(FirstRunDelay); + DateTime triggerDate; + + if (lastResult == null) + { + // Task has never been completed before + triggerDate = DateTime.UtcNow.AddHours(1); + } + else + { + triggerDate = new[] { lastResult.EndTimeUtc, _lastStartDate }.Max().Add(Interval); + } if (DateTime.UtcNow > triggerDate) { - if (isApplicationStartup) - { - triggerDate = DateTime.UtcNow.AddMinutes(1); - } - else - { - triggerDate = DateTime.UtcNow.AddMinutes(1); - } + triggerDate = DateTime.UtcNow.AddMinutes(1); } Timer = new Timer(state => OnTriggered(), null, triggerDate - DateTime.UtcNow, TimeSpan.FromMilliseconds(-1)); @@ -98,8 +91,11 @@ namespace MediaBrowser.Common.ScheduledTasks /// private void OnTriggered() { + DisposeTimer(); + if (Triggered != null) { + _lastStartDate = DateTime.UtcNow; Triggered(this, new GenericEventArgs(TaskOptions)); } }