aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-09-09 15:42:40 -0400
committerGitHub <noreply@github.com>2016-09-09 15:42:40 -0400
commit080a6511dc44edde960e6aefcab7e6cc068a3414 (patch)
tree499c61fec48dcc080888d9cfc021baf734886fe7 /MediaBrowser.Common.Implementations
parent51051c27cd4a30010eee98f4f99ebb895e166a91 (diff)
parent5ad606a2232c6911e2cd8cf5d03da635c7c0c75d (diff)
Merge pull request #2151 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Common.Implementations')
-rw-r--r--MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs10
-rw-r--r--MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs16
2 files changed, 12 insertions, 14 deletions
diff --git a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs
index 4e01041bc..10c0f8fc9 100644
--- a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs
+++ b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs
@@ -142,9 +142,15 @@ namespace MediaBrowser.Common.Implementations.Security
}
set
{
- if (value != LicenseFile.RegKey)
+ var newValue = value;
+ if (newValue != null)
{
- LicenseFile.RegKey = value;
+ newValue = newValue.Trim();
+ }
+
+ if (newValue != LicenseFile.RegKey)
+ {
+ LicenseFile.RegKey = newValue;
LicenseFile.Save();
// re-load registration info
diff --git a/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs b/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
index 6281ab3ed..84c08439e 100644
--- a/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
+++ b/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
@@ -14,16 +14,14 @@ namespace MediaBrowser.Common.Implementations.Updates
{
private readonly IHttpClient _httpClient;
private readonly IJsonSerializer _jsonSerializer;
- private TimeSpan _cacheLength;
- public GithubUpdater(IHttpClient httpClient, IJsonSerializer jsonSerializer, TimeSpan cacheLength)
+ public GithubUpdater(IHttpClient httpClient, IJsonSerializer jsonSerializer)
{
_httpClient = httpClient;
_jsonSerializer = jsonSerializer;
- _cacheLength = cacheLength;
}
- public async Task<CheckForUpdateResult> CheckForUpdateResult(string organzation, string repository, Version minVersion, PackageVersionClass updateLevel, string assetFilename, string packageName, string targetFilename, CancellationToken cancellationToken)
+ public async Task<CheckForUpdateResult> CheckForUpdateResult(string organzation, string repository, Version minVersion, PackageVersionClass updateLevel, string assetFilename, string packageName, string targetFilename, TimeSpan cacheLength, CancellationToken cancellationToken)
{
var url = string.Format("https://api.github.com/repos/{0}/{1}/releases", organzation, repository);
@@ -35,10 +33,10 @@ namespace MediaBrowser.Common.Implementations.Updates
UserAgent = "Emby/3.0"
};
- if (_cacheLength.Ticks > 0)
+ if (cacheLength.Ticks > 0)
{
options.CacheMode = CacheMode.Unconditional;
- options.CacheLength = _cacheLength;
+ options.CacheLength = cacheLength;
}
using (var stream = await _httpClient.Get(options).ConfigureAwait(false))
@@ -110,12 +108,6 @@ namespace MediaBrowser.Common.Implementations.Updates
UserAgent = "Emby/3.0"
};
- if (_cacheLength.Ticks > 0)
- {
- options.CacheMode = CacheMode.Unconditional;
- options.CacheLength = _cacheLength;
- }
-
using (var stream = await _httpClient.Get(options).ConfigureAwait(false))
{
var obj = _jsonSerializer.DeserializeFromStream<RootObject[]>(stream);