The Free Software Media System - Server Backend & API
removed commented code
Claus Viume0e5a487c3b1
diff --git a/MediaBrowser.Api/PluginService.cs b/MediaBrowser.Api/PluginService.csindex 370cec58d7..17822fb54f 100644--- a/MediaBrowser.Api/PluginService.cs+++ b/MediaBrowser.Api/PluginService.cs@@ -75,7 +75,7 @@ namespace MediaBrowser.Api/// <value>The request stream.</value>public Stream RequestStream { get; set; }}-+//TODO Once we have proper apps and plugins and decide to break compatibility with paid plugins,// delete all these registration endpoints. They are only kept for compatibility.[Route("/Registrations/{Name}", "GET", Summary = "Gets registration status for a feature", IsHidden = true)]@@ -85,7 +85,7 @@ namespace MediaBrowser.Api[ApiMember(Name = "Name", Description = "Feature Name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]public string Name { get; set; }}-+/// <summary>/// Class GetPluginSecurityInfo/// </summary>@@ -94,7 +94,7 @@ namespace MediaBrowser.Apipublic class GetPluginSecurityInfo : IReturn<PluginSecurityInfo>{}-+/// <summary>/// Class UpdatePluginSecurityInfo/// </summary>@@ -103,7 +103,7 @@ namespace MediaBrowser.Apipublic class UpdatePluginSecurityInfo : PluginSecurityInfo, IReturnVoid{}-+[Route("/Plugins/RegistrationRecords/{Name}", "GET", Summary = "Gets registration status for a feature", IsHidden = true)][Authenticated]public class GetRegistrationStatus@@ -111,7 +111,7 @@ namespace MediaBrowser.Api[ApiMember(Name = "Name", Description = "Feature Name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]public string Name { get; set; }}-+// TODO these two classes are only kept for compability with paid plugins and should be removedpublic class RegistrationInfo{@@ -120,7 +120,7 @@ namespace MediaBrowser.Apipublic bool IsTrial { get; set; }public bool IsRegistered { get; set; }}-+public class MBRegistrationRecord{public DateTime ExpirationDate { get; set; }@@ -130,7 +130,7 @@ namespace MediaBrowser.Apipublic bool TrialVersion { get; set; }public bool IsValid { get; set; }}-+public class PluginSecurityInfo{public string SupporterKey { get; set; }@@ -168,7 +168,7 @@ namespace MediaBrowser.Api_deviceManager = deviceManager;_jsonSerializer = jsonSerializer;}-+/// <summary>/// Gets the specified request./// </summary>@@ -184,13 +184,13 @@ namespace MediaBrowser.ApiIsValid = true,RegError = false};-+return ToOptimizedResult(record);}-+//TODO this function is only kept for compatibility and should be removed once paid plugins breakpublic async Task<object> Get(GetRegistration request)- {+ {var info = new RegistrationInfo{ExpirationDate = DateTime.Now.AddYears(100),@@ -198,10 +198,10 @@ namespace MediaBrowser.ApiIsTrial = false,Name = request.Name};-+return ToOptimizedResult(info);}-+/// <summary>/// Gets the specified request./// </summary>@@ -209,46 +209,7 @@ namespace MediaBrowser.Api/// <returns>System.Object.</returns>public async Task<object> Get(GetPlugins request){- // TODO This code can be reused for a proper Jellyfin plugin store (maybe). Remove/reuse when decided.- var result = _appHost.Plugins.OrderBy(p => p.Name).Select(p => p.GetPluginInfo()).ToArray();-// var requireAppStoreEnabled = request.IsAppStoreEnabled.HasValue && request.IsAppStoreEnabled.Value;-//-// // Don't fail just on account of image url's-// try-// {-// var packages = (await _installationManager.GetAvailablePackagesWithoutRegistrationInfo(CancellationToken.None));-//-// foreach (var plugin in result)-// {-// var pkg = packages.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i.guid) && string.Equals(i.guid.Replace("-", string.Empty), plugin.Id.Replace("-", string.Empty), StringComparison.OrdinalIgnoreCase));-//-// if (pkg != null)-// {-// plugin.ImageUrl = pkg.thumbImage;-// }-// }-//-// if (requireAppStoreEnabled)-// {-// result = result-// .Where(plugin =>-// {-// var pkg = packages.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i.guid) && new Guid(plugin.Id).Equals(new Guid(i.guid)));-// return pkg != null && pkg.enableInAppStore;-//-// })-// .ToArray();-// }-// }-// catch (Exception ex)-// {-// Logger.LogError(ex, "Error getting plugin list");-// // Play it safe here-// if (requireAppStoreEnabled)-// {-// result = new PluginInfo[] { };-// }-// }+ var result = _appHost.Plugins.OrderBy(p => p.Name).Select(p => p.GetPluginInfo()).ToArray();return ToOptimizedResult(result);}@@ -264,7 +225,7 @@ namespace MediaBrowser.Apireturn ToOptimizedResult(plugin.Configuration);}-+/// <summary>/// Gets the specified request./// </summary>@@ -277,10 +238,10 @@ namespace MediaBrowser.ApiIsMBSupporter = true,SupporterKey = "IAmTotallyLegit"};-+return ToOptimizedResult(result);}-+/// <summary>/// Posts the specified request./// </summary>@@ -289,7 +250,7 @@ namespace MediaBrowser.Api{return Task.CompletedTask;}-+/// <summary>/// Posts the specified request./// </summary>