aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common.Implementations')
-rw-r--r--MediaBrowser.Common.Implementations/Archiving/ZipClient.cs2
-rw-r--r--MediaBrowser.Common.Implementations/BaseApplicationHost.cs5
-rw-r--r--MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs1
-rw-r--r--MediaBrowser.Common.Implementations/Devices/DeviceId.cs1
-rw-r--r--MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs1
-rw-r--r--MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs1
-rw-r--r--MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs4
-rw-r--r--MediaBrowser.Common.Implementations/Security/MBLicenseFile.cs4
-rw-r--r--MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs4
-rw-r--r--MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs3
-rw-r--r--MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs1
-rw-r--r--MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs2
-rw-r--r--MediaBrowser.Common.Implementations/Updates/InstallationManager.cs5
13 files changed, 10 insertions, 24 deletions
diff --git a/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs b/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs
index 0009c7193..1272e43b9 100644
--- a/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs
+++ b/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs
@@ -5,10 +5,8 @@ using SharpCompress.Archive.Tar;
using SharpCompress.Common;
using SharpCompress.Reader;
using SharpCompress.Reader.Zip;
-using System;
using System.IO;
using CommonIO;
-using MediaBrowser.Common.IO;
namespace MediaBrowser.Common.Implementations.Archiving
{
diff --git a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs
index caf8f54a6..f44c975d4 100644
--- a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs
+++ b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs
@@ -7,7 +7,6 @@ using MediaBrowser.Common.Implementations.ScheduledTasks;
using MediaBrowser.Common.Implementations.Security;
using MediaBrowser.Common.Implementations.Serialization;
using MediaBrowser.Common.Implementations.Updates;
-using MediaBrowser.Common.IO;
using MediaBrowser.Common.Net;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.Progress;
@@ -251,7 +250,7 @@ namespace MediaBrowser.Common.Implementations
progress.Report(15);
var innerProgress = new ActionableProgress<double>();
- innerProgress.RegisterAction(p => progress.Report((.8 * p) + 15));
+ innerProgress.RegisterAction(p => progress.Report(.8 * p + 15));
await RegisterResources(innerProgress).ConfigureAwait(false);
@@ -661,7 +660,7 @@ namespace MediaBrowser.Common.Implementations
{
try
{
- return Assembly.Load(File.ReadAllBytes((file)));
+ return Assembly.Load(File.ReadAllBytes(file));
}
catch (Exception ex)
{
diff --git a/MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs b/MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs
index 276da58d4..419b85fa7 100644
--- a/MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs
+++ b/MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs
@@ -2,7 +2,6 @@
using System;
using System.IO;
using System.Linq;
-using MediaBrowser.Common.IO;
namespace MediaBrowser.Common.Implementations.Configuration
{
diff --git a/MediaBrowser.Common.Implementations/Devices/DeviceId.cs b/MediaBrowser.Common.Implementations/Devices/DeviceId.cs
index 4cad3cd31..f1581704b 100644
--- a/MediaBrowser.Common.Implementations/Devices/DeviceId.cs
+++ b/MediaBrowser.Common.Implementations/Devices/DeviceId.cs
@@ -4,7 +4,6 @@ using System;
using System.IO;
using System.Text;
using CommonIO;
-using MediaBrowser.Common.IO;
namespace MediaBrowser.Common.Implementations.Devices
{
diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs
index f3316646b..3aab59ee1 100644
--- a/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs
+++ b/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs
@@ -11,7 +11,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CommonIO;
-using MediaBrowser.Common.IO;
using Microsoft.Win32;
namespace MediaBrowser.Common.Implementations.ScheduledTasks
diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs
index c7423a775..b4cc5d753 100644
--- a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs
+++ b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs
@@ -1,5 +1,4 @@
using MediaBrowser.Common.Configuration;
-using MediaBrowser.Common.IO;
using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Model.Logging;
using System;
diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs
index 8507d3184..b18ea03b1 100644
--- a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs
+++ b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs
@@ -1,9 +1,7 @@
using MediaBrowser.Common.Configuration;
-using MediaBrowser.Common.IO;
using MediaBrowser.Common.ScheduledTasks;
using System;
using System.Collections.Generic;
-using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@@ -57,7 +55,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
public Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
{
// Delete log files more than n days old
- var minDateModified = DateTime.UtcNow.AddDays(-(ConfigurationManager.CommonConfiguration.LogFileRetentionDays));
+ var minDateModified = DateTime.UtcNow.AddDays(-ConfigurationManager.CommonConfiguration.LogFileRetentionDays);
var filesToDelete = _fileSystem.GetFiles(ConfigurationManager.CommonApplicationPaths.LogDirectoryPath, true)
.Where(f => _fileSystem.GetLastWriteTimeUtc(f) < minDateModified)
diff --git a/MediaBrowser.Common.Implementations/Security/MBLicenseFile.cs b/MediaBrowser.Common.Implementations/Security/MBLicenseFile.cs
index 79e558794..78515cd14 100644
--- a/MediaBrowser.Common.Implementations/Security/MBLicenseFile.cs
+++ b/MediaBrowser.Common.Implementations/Security/MBLicenseFile.cs
@@ -103,11 +103,11 @@ namespace MediaBrowser.Common.Implementations.Security
}
catch (DirectoryNotFoundException)
{
- (File.Create(licenseFile)).Close();
+ File.Create(licenseFile).Close();
}
catch (FileNotFoundException)
{
- (File.Create(licenseFile)).Close();
+ File.Create(licenseFile).Close();
}
}
if (contents != null && contents.Length > 0)
diff --git a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs
index a6dbf77e9..af58c3731 100644
--- a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs
+++ b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs
@@ -299,7 +299,7 @@ namespace MediaBrowser.Common.Implementations.Security
};
record.TrialVersion = IsInTrial(reg.expDate, record.RegChecked, record.IsRegistered);
- record.IsValid = !record.RegChecked || (record.IsRegistered || record.TrialVersion);
+ record.IsValid = !record.RegChecked || record.IsRegistered || record.TrialVersion;
return record;
}
@@ -314,7 +314,7 @@ namespace MediaBrowser.Common.Implementations.Security
var isInTrial = expirationDate > DateTime.UtcNow;
- return (isInTrial && !isRegistered);
+ return isInTrial && !isRegistered;
}
/// <summary>
diff --git a/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs b/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs
index 269294b36..6610cd3ff 100644
--- a/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs
+++ b/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs
@@ -1,5 +1,4 @@
-using MediaBrowser.Common.IO;
-using MediaBrowser.Model.Serialization;
+using MediaBrowser.Model.Serialization;
using System;
using System.IO;
using CommonIO;
diff --git a/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs b/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs
index 449c23b2d..189fb7afc 100644
--- a/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs
+++ b/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs
@@ -4,7 +4,6 @@ using System.Collections.Concurrent;
using System.IO;
using System.Xml;
using CommonIO;
-using MediaBrowser.Common.IO;
namespace MediaBrowser.Common.Implementations.Serialization
{
diff --git a/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs b/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
index 360428072..82ebf92b2 100644
--- a/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
+++ b/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
@@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using System.Reflection;
-using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Net;
diff --git a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs
index 8e0df9005..5c82ccb0e 100644
--- a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs
+++ b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs
@@ -1,7 +1,6 @@
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Events;
using MediaBrowser.Common.Implementations.Security;
-using MediaBrowser.Common.IO;
using MediaBrowser.Common.Net;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.Progress;
@@ -200,7 +199,7 @@ namespace MediaBrowser.Common.Implementations.Updates
{
var packages = _jsonSerializer.DeserializeFromStream<List<PackageInfo>>(stream).ToList();
- if ((DateTime.UtcNow - _lastPackageUpdateTime) > GetCacheLength())
+ if (DateTime.UtcNow - _lastPackageUpdateTime > GetCacheLength())
{
UpdateCachedPackages(CancellationToken.None, false);
}
@@ -233,7 +232,7 @@ namespace MediaBrowser.Common.Implementations.Updates
try
{
- if ((DateTime.UtcNow - _lastPackageUpdateTime) < GetCacheLength())
+ if (DateTime.UtcNow - _lastPackageUpdateTime < GetCacheLength())
{
return;
}