aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Plugins/BasePlugin.cs
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2019-01-22 18:13:47 -0500
committerGitHub <noreply@github.com>2019-01-22 18:13:47 -0500
commit28483bdb54be96ae83e0fded097f534d7e26ba1e (patch)
treee7f4b92326417ebf55eecdf68a01d2c3b9e660d7 /MediaBrowser.Common/Plugins/BasePlugin.cs
parent920c39454c05e979eabe81877269cd4517a03ccf (diff)
parent8106c8393b711a7e1d40487e3caf2b014decbe28 (diff)
Merge pull request #651 from jellyfin/release-10.1.0
Release 10.1.0
Diffstat (limited to 'MediaBrowser.Common/Plugins/BasePlugin.cs')
-rw-r--r--MediaBrowser.Common/Plugins/BasePlugin.cs51
1 files changed, 12 insertions, 39 deletions
diff --git a/MediaBrowser.Common/Plugins/BasePlugin.cs b/MediaBrowser.Common/Plugins/BasePlugin.cs
index 82eb6ba4b..1ff2e98ef 100644
--- a/MediaBrowser.Common/Plugins/BasePlugin.cs
+++ b/MediaBrowser.Common/Plugins/BasePlugin.cs
@@ -1,8 +1,8 @@
-using MediaBrowser.Common.Configuration;
-using MediaBrowser.Model.Plugins;
-using MediaBrowser.Model.Serialization;
using System;
using System.IO;
+using MediaBrowser.Common.Configuration;
+using MediaBrowser.Model.Plugins;
+using MediaBrowser.Model.Serialization;
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,12 +212,12 @@ 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)
{
- throw new ArgumentNullException("configuration");
+ throw new ArgumentNullException(nameof(configuration));
}
Configuration = (TConfigurationType)configuration;
@@ -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()
{