aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common')
-rw-r--r--MediaBrowser.Common/Configuration/ConfigurationUpdateEventArgs.cs2
-rw-r--r--MediaBrowser.Common/Configuration/IApplicationPaths.cs1
-rw-r--r--MediaBrowser.Common/Configuration/IConfigurationFactory.cs2
-rw-r--r--MediaBrowser.Common/Configuration/IConfigurationManager.cs2
-rw-r--r--MediaBrowser.Common/Events/EventHelper.cs2
-rw-r--r--MediaBrowser.Common/Extensions/BaseExtensions.cs3
-rw-r--r--MediaBrowser.Common/Extensions/ResourceNotFoundException.cs2
-rw-r--r--MediaBrowser.Common/IApplicationHost.cs6
-rw-r--r--MediaBrowser.Common/MediaBrowser.Common.csproj2
-rw-r--r--MediaBrowser.Common/Net/HttpRequestOptions.cs24
-rw-r--r--MediaBrowser.Common/Net/HttpResponseInfo.cs4
-rw-r--r--MediaBrowser.Common/Net/IHttpClient.cs4
-rw-r--r--MediaBrowser.Common/Net/INetworkManager.cs8
-rw-r--r--MediaBrowser.Common/Plugins/BasePlugin.cs47
-rw-r--r--MediaBrowser.Common/Plugins/IPlugin.cs6
-rw-r--r--MediaBrowser.Common/Progress/ActionableProgress.cs3
-rw-r--r--MediaBrowser.Common/Updates/IInstallationManager.cs12
-rw-r--r--MediaBrowser.Common/Updates/InstallationEventArgs.cs2
-rw-r--r--MediaBrowser.Common/Updates/InstallationFailedEventArgs.cs4
19 files changed, 48 insertions, 88 deletions
diff --git a/MediaBrowser.Common/Configuration/ConfigurationUpdateEventArgs.cs b/MediaBrowser.Common/Configuration/ConfigurationUpdateEventArgs.cs
index 310e2aa63..0b59627cc 100644
--- a/MediaBrowser.Common/Configuration/ConfigurationUpdateEventArgs.cs
+++ b/MediaBrowser.Common/Configuration/ConfigurationUpdateEventArgs.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace MediaBrowser.Common.Configuration
{
diff --git a/MediaBrowser.Common/Configuration/IApplicationPaths.cs b/MediaBrowser.Common/Configuration/IApplicationPaths.cs
index c6256bc5a..27092c0e1 100644
--- a/MediaBrowser.Common/Configuration/IApplicationPaths.cs
+++ b/MediaBrowser.Common/Configuration/IApplicationPaths.cs
@@ -1,4 +1,3 @@
-
namespace MediaBrowser.Common.Configuration
{
/// <summary>
diff --git a/MediaBrowser.Common/Configuration/IConfigurationFactory.cs b/MediaBrowser.Common/Configuration/IConfigurationFactory.cs
index 6ed638536..0fb2b83d1 100644
--- a/MediaBrowser.Common/Configuration/IConfigurationFactory.cs
+++ b/MediaBrowser.Common/Configuration/IConfigurationFactory.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
namespace MediaBrowser.Common.Configuration
diff --git a/MediaBrowser.Common/Configuration/IConfigurationManager.cs b/MediaBrowser.Common/Configuration/IConfigurationManager.cs
index d826a3ee7..8fed2dcdf 100644
--- a/MediaBrowser.Common/Configuration/IConfigurationManager.cs
+++ b/MediaBrowser.Common/Configuration/IConfigurationManager.cs
@@ -1,6 +1,6 @@
-using MediaBrowser.Model.Configuration;
using System;
using System.Collections.Generic;
+using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Common.Configuration
{
diff --git a/MediaBrowser.Common/Events/EventHelper.cs b/MediaBrowser.Common/Events/EventHelper.cs
index 2630ce7da..0ac7905a1 100644
--- a/MediaBrowser.Common/Events/EventHelper.cs
+++ b/MediaBrowser.Common/Events/EventHelper.cs
@@ -1,6 +1,6 @@
-using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
namespace MediaBrowser.Common.Events
{
diff --git a/MediaBrowser.Common/Extensions/BaseExtensions.cs b/MediaBrowser.Common/Extensions/BaseExtensions.cs
index 520c04244..db0514bb1 100644
--- a/MediaBrowser.Common/Extensions/BaseExtensions.cs
+++ b/MediaBrowser.Common/Extensions/BaseExtensions.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Globalization;
+using System;
using System.Text.RegularExpressions;
using MediaBrowser.Model.Cryptography;
diff --git a/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs b/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs
index 89e20b1b4..f62c65fd7 100644
--- a/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs
+++ b/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace MediaBrowser.Common.Extensions
{
diff --git a/MediaBrowser.Common/IApplicationHost.cs b/MediaBrowser.Common/IApplicationHost.cs
index c4f760b15..bc6c3a984 100644
--- a/MediaBrowser.Common/IApplicationHost.cs
+++ b/MediaBrowser.Common/IApplicationHost.cs
@@ -1,10 +1,10 @@
-using MediaBrowser.Common.Plugins;
-using MediaBrowser.Model.Events;
-using MediaBrowser.Model.Updates;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
+using MediaBrowser.Common.Plugins;
+using MediaBrowser.Model.Events;
+using MediaBrowser.Model.Updates;
namespace MediaBrowser.Common
{
diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj
index af5536b36..2220d4661 100644
--- a/MediaBrowser.Common/MediaBrowser.Common.csproj
+++ b/MediaBrowser.Common/MediaBrowser.Common.csproj
@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Authors>Jellyfin Contributors</Authors>
diff --git a/MediaBrowser.Common/Net/HttpRequestOptions.cs b/MediaBrowser.Common/Net/HttpRequestOptions.cs
index c61e88c87..dadac5e03 100644
--- a/MediaBrowser.Common/Net/HttpRequestOptions.cs
+++ b/MediaBrowser.Common/Net/HttpRequestOptions.cs
@@ -1,9 +1,7 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
-using System.Net;
using System.Threading;
-using System.Text;
namespace MediaBrowser.Common.Net
{
@@ -26,11 +24,8 @@ namespace MediaBrowser.Common.Net
/// <value>The accept header.</value>
public string AcceptHeader
{
- get { return GetHeaderValue("Accept"); }
- set
- {
- RequestHeaders["Accept"] = value;
- }
+ get => GetHeaderValue("Accept");
+ set => RequestHeaders["Accept"] = value;
}
/// <summary>
/// Gets or sets the cancellation token.
@@ -50,11 +45,8 @@ namespace MediaBrowser.Common.Net
/// <value>The user agent.</value>
public string UserAgent
{
- get { return GetHeaderValue("User-Agent"); }
- set
- {
- RequestHeaders["User-Agent"] = value;
- }
+ get => GetHeaderValue("User-Agent");
+ set => RequestHeaders["User-Agent"] = value;
}
/// <summary>
@@ -110,9 +102,7 @@ namespace MediaBrowser.Common.Net
private string GetHeaderValue(string name)
{
- string value;
-
- RequestHeaders.TryGetValue(name, out value);
+ RequestHeaders.TryGetValue(name, out var value);
return value;
}
@@ -133,7 +123,7 @@ namespace MediaBrowser.Common.Net
TimeoutMs = 20000;
}
- public void SetPostData(IDictionary<string,string> values)
+ public void SetPostData(IDictionary<string, string> values)
{
var strings = values.Keys.Select(key => string.Format("{0}={1}", key, values[key]));
var postContent = string.Join("&", strings.ToArray());
diff --git a/MediaBrowser.Common/Net/HttpResponseInfo.cs b/MediaBrowser.Common/Net/HttpResponseInfo.cs
index a36550a28..186674167 100644
--- a/MediaBrowser.Common/Net/HttpResponseInfo.cs
+++ b/MediaBrowser.Common/Net/HttpResponseInfo.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
@@ -50,7 +50,7 @@ namespace MediaBrowser.Common.Net
/// Gets or sets the headers.
/// </summary>
/// <value>The headers.</value>
- public Dictionary<string,string> Headers { get; set; }
+ public Dictionary<string, string> Headers { get; set; }
private readonly IDisposable _disposable;
diff --git a/MediaBrowser.Common/Net/IHttpClient.cs b/MediaBrowser.Common/Net/IHttpClient.cs
index f88cfbb2b..5aaf7e0be 100644
--- a/MediaBrowser.Common/Net/IHttpClient.cs
+++ b/MediaBrowser.Common/Net/IHttpClient.cs
@@ -1,4 +1,4 @@
-using System.IO;
+using System.IO;
using System.Threading.Tasks;
namespace MediaBrowser.Common.Net
@@ -43,7 +43,7 @@ namespace MediaBrowser.Common.Net
/// <param name="options">The options.</param>
/// <returns>Task{System.String}.</returns>
/// <exception cref="System.ArgumentNullException">progress</exception>
- /// <exception cref="MediaBrowser.Model.Net.HttpException"></exception>
+ /// <exception cref="Model.Net.HttpException"></exception>
Task<string> GetTempFile(HttpRequestOptions options);
/// <summary>
diff --git a/MediaBrowser.Common/Net/INetworkManager.cs b/MediaBrowser.Common/Net/INetworkManager.cs
index b2ff797bc..72fb6e2b8 100644
--- a/MediaBrowser.Common/Net/INetworkManager.cs
+++ b/MediaBrowser.Common/Net/INetworkManager.cs
@@ -1,8 +1,8 @@
-using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Net;
-using System.Collections.Generic;
using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
+using MediaBrowser.Model.IO;
+using MediaBrowser.Model.Net;
namespace MediaBrowser.Common.Net
{
@@ -63,4 +63,4 @@ namespace MediaBrowser.Common.Net
bool IsAddressInSubnets(string addressString, string[] subnets);
}
-} \ No newline at end of file
+}
diff --git a/MediaBrowser.Common/Plugins/BasePlugin.cs b/MediaBrowser.Common/Plugins/BasePlugin.cs
index 2fdee381d..1ff2e98ef 100644
--- a/MediaBrowser.Common/Plugins/BasePlugin.cs
+++ b/MediaBrowser.Common/Plugins/BasePlugin.cs
@@ -1,8 +1,8 @@
+using System;
+using System.IO;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Model.Plugins;
using MediaBrowser.Model.Serialization;
-using System;
-using System.IO;
namespace MediaBrowser.Common.Plugins
{
@@ -18,10 +18,7 @@ namespace MediaBrowser.Common.Plugins
/// Gets the description.
/// </summary>
/// <value>The description.</value>
- public virtual string Description
- {
- get { return string.Empty; }
- }
+ public virtual string Description => string.Empty;
/// <summary>
/// Gets the unique id.
@@ -108,10 +105,7 @@ namespace MediaBrowser.Common.Plugins
/// Gets the type of configuration this plugin uses
/// </summary>
/// <value>The type of the configuration.</value>
- public Type ConfigurationType
- {
- get { return typeof(TConfigurationType); }
- }
+ public Type ConfigurationType => typeof(TConfigurationType);
private Action<string> _directoryCreateFn;
public void SetStartupInfo(Action<string> directoryCreateFn)
@@ -124,13 +118,7 @@ namespace MediaBrowser.Common.Plugins
/// Gets the name the assembly file
/// </summary>
/// <value>The name of the assembly file.</value>
- protected string AssemblyFileName
- {
- get
- {
- return Path.GetFileName(AssemblyFilePath);
- }
- }
+ protected string AssemblyFileName => Path.GetFileName(AssemblyFilePath);
/// <summary>
/// The _configuration sync lock
@@ -161,10 +149,7 @@ namespace MediaBrowser.Common.Plugins
}
return _configuration;
}
- protected set
- {
- _configuration = value;
- }
+ protected set => _configuration = value;
}
private TConfigurationType LoadConfiguration()
@@ -185,22 +170,13 @@ namespace MediaBrowser.Common.Plugins
/// Gets the name of the configuration file. Subclasses should override
/// </summary>
/// <value>The name of the configuration file.</value>
- public virtual string ConfigurationFileName
- {
- get { return Path.ChangeExtension(AssemblyFileName, ".xml"); }
- }
+ public virtual string ConfigurationFileName => Path.ChangeExtension(AssemblyFileName, ".xml");
/// <summary>
/// Gets the full path to the configuration file
/// </summary>
/// <value>The configuration file path.</value>
- public string ConfigurationFilePath
- {
- get
- {
- return Path.Combine(ApplicationPaths.PluginConfigurationsPath, ConfigurationFileName);
- }
- }
+ public string ConfigurationFilePath => Path.Combine(ApplicationPaths.PluginConfigurationsPath, ConfigurationFileName);
/// <summary>
/// Initializes a new instance of the <see cref="BasePlugin{TConfigurationType}" /> class.
@@ -236,7 +212,7 @@ namespace MediaBrowser.Common.Plugins
/// Returns true or false indicating success or failure
/// </summary>
/// <param name="configuration">The configuration.</param>
- /// <exception cref="System.ArgumentNullException">configuration</exception>
+ /// <exception cref="ArgumentNullException">configuration</exception>
public virtual void UpdateConfiguration(BasePluginConfiguration configuration)
{
if (configuration == null)
@@ -253,10 +229,7 @@ namespace MediaBrowser.Common.Plugins
/// Gets the plugin's configuration
/// </summary>
/// <value>The configuration.</value>
- BasePluginConfiguration IHasPluginConfiguration.Configuration
- {
- get { return Configuration; }
- }
+ BasePluginConfiguration IHasPluginConfiguration.Configuration => Configuration;
public override PluginInfo GetPluginInfo()
{
diff --git a/MediaBrowser.Common/Plugins/IPlugin.cs b/MediaBrowser.Common/Plugins/IPlugin.cs
index bffd21143..32527c299 100644
--- a/MediaBrowser.Common/Plugins/IPlugin.cs
+++ b/MediaBrowser.Common/Plugins/IPlugin.cs
@@ -1,5 +1,5 @@
-using MediaBrowser.Model.Plugins;
using System;
+using MediaBrowser.Model.Plugins;
namespace MediaBrowser.Common.Plugins
{
@@ -69,7 +69,7 @@ namespace MediaBrowser.Common.Plugins
/// Returns true or false indicating success or failure
/// </summary>
/// <param name="configuration">The configuration.</param>
- /// <exception cref="System.ArgumentNullException">configuration</exception>
+ /// <exception cref="ArgumentNullException">configuration</exception>
void UpdateConfiguration(BasePluginConfiguration configuration);
/// <summary>
@@ -80,4 +80,4 @@ namespace MediaBrowser.Common.Plugins
void SetStartupInfo(Action<string> directoryCreateFn);
}
-} \ No newline at end of file
+}
diff --git a/MediaBrowser.Common/Progress/ActionableProgress.cs b/MediaBrowser.Common/Progress/ActionableProgress.cs
index 67347bc15..9fe01931f 100644
--- a/MediaBrowser.Common/Progress/ActionableProgress.cs
+++ b/MediaBrowser.Common/Progress/ActionableProgress.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Collections.Generic;
+using System;
namespace MediaBrowser.Common.Progress
{
diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.cs
index a3e0277d9..a263be35f 100644
--- a/MediaBrowser.Common/Updates/IInstallationManager.cs
+++ b/MediaBrowser.Common/Updates/IInstallationManager.cs
@@ -1,10 +1,10 @@
-using MediaBrowser.Common.Plugins;
-using MediaBrowser.Model.Events;
-using MediaBrowser.Model.Updates;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
+using MediaBrowser.Common.Plugins;
+using MediaBrowser.Model.Events;
+using MediaBrowser.Model.Updates;
namespace MediaBrowser.Common.Updates
{
@@ -106,14 +106,14 @@ namespace MediaBrowser.Common.Updates
/// <param name="progress">The progress.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- /// <exception cref="System.ArgumentNullException">package</exception>
+ /// <exception cref="ArgumentNullException">package</exception>
Task InstallPackage(PackageVersionInfo package, bool isPlugin, IProgress<double> progress, CancellationToken cancellationToken);
/// <summary>
/// Uninstalls a plugin
/// </summary>
/// <param name="plugin">The plugin.</param>
- /// <exception cref="System.ArgumentException"></exception>
+ /// <exception cref="ArgumentException"></exception>
void UninstallPlugin(IPlugin plugin);
}
-} \ No newline at end of file
+}
diff --git a/MediaBrowser.Common/Updates/InstallationEventArgs.cs b/MediaBrowser.Common/Updates/InstallationEventArgs.cs
index 9dc8ead83..9f215e889 100644
--- a/MediaBrowser.Common/Updates/InstallationEventArgs.cs
+++ b/MediaBrowser.Common/Updates/InstallationEventArgs.cs
@@ -1,4 +1,4 @@
-using MediaBrowser.Model.Updates;
+using MediaBrowser.Model.Updates;
namespace MediaBrowser.Common.Updates
{
diff --git a/MediaBrowser.Common/Updates/InstallationFailedEventArgs.cs b/MediaBrowser.Common/Updates/InstallationFailedEventArgs.cs
index 69dc1ee98..43adfb02d 100644
--- a/MediaBrowser.Common/Updates/InstallationFailedEventArgs.cs
+++ b/MediaBrowser.Common/Updates/InstallationFailedEventArgs.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace MediaBrowser.Common.Updates
{
@@ -6,4 +6,4 @@ namespace MediaBrowser.Common.Updates
{
public Exception Exception { get; set; }
}
-} \ No newline at end of file
+}