aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily <JustAMan@users.noreply.github.com>2020-04-21 01:45:52 +0300
committerGitHub <noreply@github.com>2020-04-21 01:45:52 +0300
commit07143bcb68f010c59274bbe8e7c0e03a843e916b (patch)
tree892b17bc230093768e4d9fc3cb3fcf2b823d6d4d
parent32ccab32bf49cd87a13aa3e6344a0736c51b0ff7 (diff)
parente6ef680775be122c3fcfbe64d4b8d868197b6f5e (diff)
Merge pull request #2466 from dkanada/plugin
Update plugin classes for nightly builds
-rw-r--r--Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs10
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs14
-rw-r--r--Emby.Server.Implementations/ConfigurationOptions.cs2
-rw-r--r--Emby.Server.Implementations/Updates/InstallationManager.cs77
-rw-r--r--MediaBrowser.Api/PackageService.cs44
-rw-r--r--MediaBrowser.Common/IApplicationHost.cs6
-rw-r--r--MediaBrowser.Common/Plugins/BasePlugin.cs8
-rw-r--r--MediaBrowser.Common/Updates/IInstallationManager.cs22
-rw-r--r--MediaBrowser.Common/Updates/InstallationEventArgs.cs2
-rw-r--r--MediaBrowser.Model/Services/IHasRequestFilter.cs10
-rw-r--r--MediaBrowser.Model/System/SystemInfo.cs2
-rw-r--r--MediaBrowser.Model/Updates/CheckForUpdateResult.cs29
-rw-r--r--MediaBrowser.Model/Updates/InstallationInfo.cs18
-rw-r--r--MediaBrowser.Model/Updates/PackageInfo.cs128
-rw-r--r--MediaBrowser.Model/Updates/PackageTargetSystem.cs23
-rw-r--r--MediaBrowser.Model/Updates/PackageVersionClass.cs23
-rw-r--r--MediaBrowser.Model/Updates/PackageVersionInfo.cs96
-rw-r--r--MediaBrowser.Model/Updates/VersionInfo.cs58
18 files changed, 129 insertions, 443 deletions
diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
index 9f1d5096d..0925d72a6 100644
--- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
+++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
@@ -422,7 +422,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- private void OnPluginUpdated(object sender, GenericEventArgs<(IPlugin, PackageVersionInfo)> e)
+ private void OnPluginUpdated(object sender, GenericEventArgs<(IPlugin, VersionInfo)> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -434,8 +434,8 @@ namespace Emby.Server.Implementations.Activity
ShortOverview = string.Format(
CultureInfo.InvariantCulture,
_localization.GetLocalizedString("VersionNumber"),
- e.Argument.Item2.versionStr),
- Overview = e.Argument.Item2.description
+ e.Argument.Item2.version),
+ Overview = e.Argument.Item2.changelog
});
}
@@ -451,7 +451,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- private void OnPluginInstalled(object sender, GenericEventArgs<PackageVersionInfo> e)
+ private void OnPluginInstalled(object sender, GenericEventArgs<VersionInfo> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -463,7 +463,7 @@ namespace Emby.Server.Implementations.Activity
ShortOverview = string.Format(
CultureInfo.InvariantCulture,
_localization.GetLocalizedString("VersionNumber"),
- e.Argument.versionStr)
+ e.Argument.version)
});
}
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 3f5ae5536..d6d153818 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -211,19 +211,6 @@ namespace Emby.Server.Implementations
public IFileSystem FileSystemManager { get; set; }
- /// <inheritdoc />
- public PackageVersionClass SystemUpdateLevel
- {
- get
- {
-#if BETA
- return PackageVersionClass.Beta;
-#else
- return PackageVersionClass.Release;
-#endif
- }
- }
-
/// <summary>
/// Gets or sets the service provider.
/// </summary>
@@ -1390,7 +1377,6 @@ namespace Emby.Server.Implementations
SupportsLibraryMonitor = true,
EncoderLocation = MediaEncoder.EncoderLocation,
SystemArchitecture = RuntimeInformation.OSArchitecture,
- SystemUpdateLevel = SystemUpdateLevel,
PackageName = StartupOptions.PackageName
};
}
diff --git a/Emby.Server.Implementations/ConfigurationOptions.cs b/Emby.Server.Implementations/ConfigurationOptions.cs
index 20bdd18e7..db7c35a7c 100644
--- a/Emby.Server.Implementations/ConfigurationOptions.cs
+++ b/Emby.Server.Implementations/ConfigurationOptions.cs
@@ -18,7 +18,7 @@ namespace Emby.Server.Implementations
{
{ HostWebClientKey, bool.TrueString },
{ HttpListenerHost.DefaultRedirectKey, "web/index.html" },
- { InstallationManager.PluginManifestUrlKey, "https://repo.jellyfin.org/releases/plugin/manifest.json" },
+ { InstallationManager.PluginManifestUrlKey, "https://repo.jellyfin.org/releases/plugin/manifest-stable.json" },
{ FfmpegProbeSizeKey, "1G" },
{ FfmpegAnalyzeDurationKey, "200M" },
{ PlaylistsAllowDuplicatesKey, bool.TrueString }
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs
index 25f70471a..0b2309889 100644
--- a/Emby.Server.Implementations/Updates/InstallationManager.cs
+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs
@@ -26,7 +26,7 @@ using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Updates
{
/// <summary>
- /// Manages all install, uninstall and update operations (both plugins and system).
+ /// Manages all install, uninstall, and update operations for the system and individual plugins.
/// </summary>
public class InstallationManager : IInstallationManager
{
@@ -36,7 +36,7 @@ namespace Emby.Server.Implementations.Updates
public const string PluginManifestUrlKey = "InstallationManager:PluginManifestUrl";
/// <summary>
- /// The _logger.
+ /// The logger.
/// </summary>
private readonly ILogger _logger;
private readonly IApplicationPaths _appPaths;
@@ -112,10 +112,10 @@ namespace Emby.Server.Implementations.Updates
public event EventHandler<GenericEventArgs<IPlugin>> PluginUninstalled;
/// <inheritdoc />
- public event EventHandler<GenericEventArgs<(IPlugin, PackageVersionInfo)>> PluginUpdated;
+ public event EventHandler<GenericEventArgs<(IPlugin, VersionInfo)>> PluginUpdated;
/// <inheritdoc />
- public event EventHandler<GenericEventArgs<PackageVersionInfo>> PluginInstalled;
+ public event EventHandler<GenericEventArgs<VersionInfo>> PluginInstalled;
/// <inheritdoc />
public IEnumerable<InstallationInfo> CompletedInstallations => _completedInstallationsInternal;
@@ -183,61 +183,56 @@ namespace Emby.Server.Implementations.Updates
}
/// <inheritdoc />
- public IEnumerable<PackageVersionInfo> GetCompatibleVersions(
- IEnumerable<PackageVersionInfo> availableVersions,
- Version minVersion = null,
- PackageVersionClass classification = PackageVersionClass.Release)
+ public IEnumerable<VersionInfo> GetCompatibleVersions(
+ IEnumerable<VersionInfo> availableVersions,
+ Version minVersion = null)
{
var appVer = _applicationHost.ApplicationVersion;
availableVersions = availableVersions
- .Where(x => x.classification == classification
- && Version.Parse(x.requiredVersionStr) <= appVer);
+ .Where(x => Version.Parse(x.targetAbi) <= appVer);
if (minVersion != null)
{
- availableVersions = availableVersions.Where(x => x.Version >= minVersion);
+ availableVersions = availableVersions.Where(x => x.version >= minVersion);
}
- return availableVersions.OrderByDescending(x => x.Version);
+ return availableVersions.OrderByDescending(x => x.version);
}
/// <inheritdoc />
- public IEnumerable<PackageVersionInfo> GetCompatibleVersions(
+ public IEnumerable<VersionInfo> GetCompatibleVersions(
IEnumerable<PackageInfo> availablePackages,
string name = null,
Guid guid = default,
- Version minVersion = null,
- PackageVersionClass classification = PackageVersionClass.Release)
+ Version minVersion = null)
{
var package = FilterPackages(availablePackages, name, guid).FirstOrDefault();
- // Package not found.
+ // Package not found in repository
if (package == null)
{
- return Enumerable.Empty<PackageVersionInfo>();
+ return Enumerable.Empty<VersionInfo>();
}
return GetCompatibleVersions(
package.versions,
- minVersion,
- classification);
+ minVersion);
}
/// <inheritdoc />
- public async Task<IEnumerable<PackageVersionInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default)
+ public async Task<IEnumerable<VersionInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default)
{
var catalog = await GetAvailablePackages(cancellationToken).ConfigureAwait(false);
return GetAvailablePluginUpdates(catalog);
}
- private IEnumerable<PackageVersionInfo> GetAvailablePluginUpdates(IReadOnlyList<PackageInfo> pluginCatalog)
+ private IEnumerable<VersionInfo> GetAvailablePluginUpdates(IReadOnlyList<PackageInfo> pluginCatalog)
{
foreach (var plugin in _applicationHost.Plugins)
{
- var compatibleversions = GetCompatibleVersions(pluginCatalog, plugin.Name, plugin.Id, plugin.Version, _applicationHost.SystemUpdateLevel);
- var version = compatibleversions.FirstOrDefault(y => y.Version > plugin.Version);
- if (version != null
- && !CompletedInstallations.Any(x => string.Equals(x.AssemblyGuid, version.guid, StringComparison.OrdinalIgnoreCase)))
+ var compatibleversions = GetCompatibleVersions(pluginCatalog, plugin.Name, plugin.Id, plugin.Version);
+ var version = compatibleversions.FirstOrDefault(y => y.version > plugin.Version);
+ if (version != null && !CompletedInstallations.Any(x => string.Equals(x.Guid, version.guid, StringComparison.OrdinalIgnoreCase)))
{
yield return version;
}
@@ -245,7 +240,7 @@ namespace Emby.Server.Implementations.Updates
}
/// <inheritdoc />
- public async Task InstallPackage(PackageVersionInfo package, CancellationToken cancellationToken)
+ public async Task InstallPackage(VersionInfo package, CancellationToken cancellationToken)
{
if (package == null)
{
@@ -254,11 +249,9 @@ namespace Emby.Server.Implementations.Updates
var installationInfo = new InstallationInfo
{
- Id = Guid.NewGuid(),
+ Guid = package.guid,
Name = package.name,
- AssemblyGuid = package.guid,
- UpdateClass = package.classification,
- Version = package.versionStr
+ Version = package.version.ToString()
};
var innerCancellationTokenSource = new CancellationTokenSource();
@@ -276,7 +269,7 @@ namespace Emby.Server.Implementations.Updates
var installationEventArgs = new InstallationEventArgs
{
InstallationInfo = installationInfo,
- PackageVersionInfo = package
+ VersionInfo = package
};
PackageInstalling?.Invoke(this, installationEventArgs);
@@ -301,7 +294,7 @@ namespace Emby.Server.Implementations.Updates
_currentInstallations.Remove(tuple);
}
- _logger.LogInformation("Package installation cancelled: {0} {1}", package.name, package.versionStr);
+ _logger.LogInformation("Package installation cancelled: {0} {1}", package.name, package.version);
PackageInstallationCancelled?.Invoke(this, installationEventArgs);
@@ -337,7 +330,7 @@ namespace Emby.Server.Implementations.Updates
/// <param name="package">The package.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns><see cref="Task" />.</returns>
- private async Task InstallPackageInternal(PackageVersionInfo package, CancellationToken cancellationToken)
+ private async Task InstallPackageInternal(VersionInfo package, CancellationToken cancellationToken)
{
// Set last update time if we were installed before
IPlugin plugin = _applicationHost.Plugins.FirstOrDefault(p => string.Equals(p.Id.ToString(), package.guid, StringComparison.OrdinalIgnoreCase))
@@ -349,26 +342,26 @@ namespace Emby.Server.Implementations.Updates
// Do plugin-specific processing
if (plugin == null)
{
- _logger.LogInformation("New plugin installed: {0} {1} {2}", package.name, package.versionStr ?? string.Empty, package.classification);
+ _logger.LogInformation("New plugin installed: {0} {1} {2}", package.name, package.version);
- PluginInstalled?.Invoke(this, new GenericEventArgs<PackageVersionInfo>(package));
+ PluginInstalled?.Invoke(this, new GenericEventArgs<VersionInfo>(package));
}
else
{
- _logger.LogInformation("Plugin updated: {0} {1} {2}", package.name, package.versionStr ?? string.Empty, package.classification);
+ _logger.LogInformation("Plugin updated: {0} {1} {2}", package.name, package.version);
- PluginUpdated?.Invoke(this, new GenericEventArgs<(IPlugin, PackageVersionInfo)>((plugin, package)));
+ PluginUpdated?.Invoke(this, new GenericEventArgs<(IPlugin, VersionInfo)>((plugin, package)));
}
_applicationHost.NotifyPendingRestart();
}
- private async Task PerformPackageInstallation(PackageVersionInfo package, CancellationToken cancellationToken)
+ private async Task PerformPackageInstallation(VersionInfo package, CancellationToken cancellationToken)
{
- var extension = Path.GetExtension(package.targetFilename);
+ var extension = Path.GetExtension(package.filename);
if (!string.Equals(extension, ".zip", StringComparison.OrdinalIgnoreCase))
{
- _logger.LogError("Only zip packages are supported. {Filename} is not a zip archive.", package.targetFilename);
+ _logger.LogError("Only zip packages are supported. {Filename} is not a zip archive.", package.filename);
return;
}
@@ -415,7 +408,7 @@ namespace Emby.Server.Implementations.Updates
}
/// <summary>
- /// Uninstalls a plugin
+ /// Uninstalls a plugin.
/// </summary>
/// <param name="plugin">The plugin.</param>
public void UninstallPlugin(IPlugin plugin)
@@ -473,7 +466,7 @@ namespace Emby.Server.Implementations.Updates
{
lock (_currentInstallationsLock)
{
- var install = _currentInstallations.Find(x => x.info.Id == id);
+ var install = _currentInstallations.Find(x => x.info.Guid == id.ToString());
if (install == default((InstallationInfo, CancellationTokenSource)))
{
return false;
diff --git a/MediaBrowser.Api/PackageService.cs b/MediaBrowser.Api/PackageService.cs
index afc3e026a..444354a99 100644
--- a/MediaBrowser.Api/PackageService.cs
+++ b/MediaBrowser.Api/PackageService.cs
@@ -42,23 +42,6 @@ namespace MediaBrowser.Api
[Authenticated]
public class GetPackages : IReturn<PackageInfo[]>
{
- /// <summary>
- /// Gets or sets the name.
- /// </summary>
- /// <value>The name.</value>
- [ApiMember(Name = "PackageType", Description = "Optional package type filter (System/UserInstalled)", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
- public string PackageType { get; set; }
-
- [ApiMember(Name = "TargetSystems", Description = "Optional. Filter by target system type. Allows multiple, comma delimited.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
- public string TargetSystems { get; set; }
-
- [ApiMember(Name = "IsPremium", Description = "Optional. Filter by premium status", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")]
- public bool? IsPremium { get; set; }
-
- [ApiMember(Name = "IsAdult", Description = "Optional. Filter by package that contain adult content.", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")]
- public bool? IsAdult { get; set; }
-
- public bool? IsAppStoreEnabled { get; set; }
}
/// <summary>
@@ -88,13 +71,6 @@ namespace MediaBrowser.Api
/// <value>The version.</value>
[ApiMember(Name = "Version", Description = "Optional version. Defaults to latest version.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
public string Version { get; set; }
-
- /// <summary>
- /// Gets or sets the update class.
- /// </summary>
- /// <value>The update class.</value>
- [ApiMember(Name = "UpdateClass", Description = "Optional update class (Dev, Beta, Release). Defaults to Release.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
- public PackageVersionClass UpdateClass { get; set; }
}
/// <summary>
@@ -154,23 +130,6 @@ namespace MediaBrowser.Api
{
IEnumerable<PackageInfo> packages = await _installationManager.GetAvailablePackages().ConfigureAwait(false);
- if (!string.IsNullOrEmpty(request.TargetSystems))
- {
- var apps = request.TargetSystems.Split(',').Select(i => (PackageTargetSystem)Enum.Parse(typeof(PackageTargetSystem), i, true));
-
- packages = packages.Where(p => apps.Contains(p.targetSystem));
- }
-
- if (request.IsAdult.HasValue)
- {
- packages = packages.Where(p => p.adult == request.IsAdult.Value);
- }
-
- if (request.IsAppStoreEnabled.HasValue)
- {
- packages = packages.Where(p => p.enableInAppStore == request.IsAppStoreEnabled.Value);
- }
-
return ToOptimizedResult(packages.ToArray());
}
@@ -186,8 +145,7 @@ namespace MediaBrowser.Api
packages,
request.Name,
string.IsNullOrEmpty(request.AssemblyGuid) ? Guid.Empty : Guid.Parse(request.AssemblyGuid),
- string.IsNullOrEmpty(request.Version) ? null : Version.Parse(request.Version),
- request.UpdateClass).FirstOrDefault();
+ string.IsNullOrEmpty(request.Version) ? null : Version.Parse(request.Version)).FirstOrDefault();
if (package == null)
{
diff --git a/MediaBrowser.Common/IApplicationHost.cs b/MediaBrowser.Common/IApplicationHost.cs
index 0e282cf53..c4381c289 100644
--- a/MediaBrowser.Common/IApplicationHost.cs
+++ b/MediaBrowser.Common/IApplicationHost.cs
@@ -49,12 +49,6 @@ namespace MediaBrowser.Common
bool CanSelfRestart { get; }
/// <summary>
- /// Gets the version class of the system.
- /// </summary>
- /// <value><see cref="PackageVersionClass.Release" /> or <see cref="PackageVersionClass.Beta" />.</value>
- PackageVersionClass SystemUpdateLevel { get; }
-
- /// <summary>
/// Gets the application version.
/// </summary>
/// <value>The application version.</value>
diff --git a/MediaBrowser.Common/Plugins/BasePlugin.cs b/MediaBrowser.Common/Plugins/BasePlugin.cs
index b24d10ff1..9e4a360c3 100644
--- a/MediaBrowser.Common/Plugins/BasePlugin.cs
+++ b/MediaBrowser.Common/Plugins/BasePlugin.cs
@@ -67,7 +67,7 @@ namespace MediaBrowser.Common.Plugins
}
/// <summary>
- /// Called when just before the plugin is uninstalled from the server.
+ /// Called just before the plugin is uninstalled from the server.
/// </summary>
public virtual void OnUninstalling()
{
@@ -101,7 +101,7 @@ namespace MediaBrowser.Common.Plugins
private readonly object _configurationSyncLock = new object();
/// <summary>
- /// The save lock.
+ /// The configuration save lock.
/// </summary>
private readonly object _configurationSaveLock = new object();
@@ -148,7 +148,7 @@ namespace MediaBrowser.Common.Plugins
protected string AssemblyFileName => Path.GetFileName(AssemblyFilePath);
/// <summary>
- /// Gets or sets the plugin's configuration.
+ /// Gets or sets the plugin configuration.
/// </summary>
/// <value>The configuration.</value>
public TConfigurationType Configuration
@@ -186,7 +186,7 @@ namespace MediaBrowser.Common.Plugins
public string ConfigurationFilePath => Path.Combine(ApplicationPaths.PluginConfigurationsPath, ConfigurationFileName);
/// <summary>
- /// Gets the plugin's configuration.
+ /// Gets the plugin configuration.
/// </summary>
/// <value>The configuration.</value>
BasePluginConfiguration IHasPluginConfiguration.Configuration => Configuration;
diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.cs
index 93f330e5b..950604432 100644
--- a/MediaBrowser.Common/Updates/IInstallationManager.cs
+++ b/MediaBrowser.Common/Updates/IInstallationManager.cs
@@ -28,12 +28,12 @@ namespace MediaBrowser.Common.Updates
/// <summary>
/// Occurs when a plugin is updated.
/// </summary>
- event EventHandler<GenericEventArgs<(IPlugin, PackageVersionInfo)>> PluginUpdated;
+ event EventHandler<GenericEventArgs<(IPlugin, VersionInfo)>> PluginUpdated;
/// <summary>
/// Occurs when a plugin is installed.
/// </summary>
- event EventHandler<GenericEventArgs<PackageVersionInfo>> PluginInstalled;
+ event EventHandler<GenericEventArgs<VersionInfo>> PluginInstalled;
/// <summary>
/// Gets the completed installations.
@@ -64,12 +64,10 @@ namespace MediaBrowser.Common.Updates
/// </summary>
/// <param name="availableVersions">The available version of the plugin.</param>
/// <param name="minVersion">The minimum required version of the plugin.</param>
- /// <param name="classification">The classification of updates.</param>
/// <returns>All compatible versions ordered from newest to oldest.</returns>
- IEnumerable<PackageVersionInfo> GetCompatibleVersions(
- IEnumerable<PackageVersionInfo> availableVersions,
- Version minVersion = null,
- PackageVersionClass classification = PackageVersionClass.Release);
+ IEnumerable<VersionInfo> GetCompatibleVersions(
+ IEnumerable<VersionInfo> availableVersions,
+ Version minVersion = null);
/// <summary>
/// Returns all compatible versions ordered from newest to oldest.
@@ -78,21 +76,19 @@ namespace MediaBrowser.Common.Updates
/// <param name="name">The name.</param>
/// <param name="guid">The guid of the plugin.</param>
/// <param name="minVersion">The minimum required version of the plugin.</param>
- /// <param name="classification">The classification.</param>
/// <returns>All compatible versions ordered from newest to oldest.</returns>
- IEnumerable<PackageVersionInfo> GetCompatibleVersions(
+ IEnumerable<VersionInfo> GetCompatibleVersions(
IEnumerable<PackageInfo> availablePackages,
string name = null,
Guid guid = default,
- Version minVersion = null,
- PackageVersionClass classification = PackageVersionClass.Release);
+ Version minVersion = null);
/// <summary>
/// Returns the available plugin updates.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The available plugin updates.</returns>
- Task<IEnumerable<PackageVersionInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default);
+ Task<IEnumerable<VersionInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default);
/// <summary>
/// Installs the package.
@@ -100,7 +96,7 @@ namespace MediaBrowser.Common.Updates
/// <param name="package">The package.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns><see cref="Task" />.</returns>
- Task InstallPackage(PackageVersionInfo package, CancellationToken cancellationToken = default);
+ Task InstallPackage(VersionInfo package, CancellationToken cancellationToken = default);
/// <summary>
/// Uninstalls a plugin.
diff --git a/MediaBrowser.Common/Updates/InstallationEventArgs.cs b/MediaBrowser.Common/Updates/InstallationEventArgs.cs
index 36e124ddf..11eb2ad34 100644
--- a/MediaBrowser.Common/Updates/InstallationEventArgs.cs
+++ b/MediaBrowser.Common/Updates/InstallationEventArgs.cs
@@ -8,6 +8,6 @@ namespace MediaBrowser.Common.Updates
{
public InstallationInfo InstallationInfo { get; set; }
- public PackageVersionInfo PackageVersionInfo { get; set; }
+ public VersionInfo VersionInfo { get; set; }
}
}
diff --git a/MediaBrowser.Model/Services/IHasRequestFilter.cs b/MediaBrowser.Model/Services/IHasRequestFilter.cs
index 3d2e9c0dc..3e49e9872 100644
--- a/MediaBrowser.Model/Services/IHasRequestFilter.cs
+++ b/MediaBrowser.Model/Services/IHasRequestFilter.cs
@@ -8,17 +8,17 @@ namespace MediaBrowser.Model.Services
{
/// <summary>
/// Order in which Request Filters are executed.
- /// &lt;0 Executed before global request filters
- /// &gt;0 Executed after global request filters
+ /// &lt;0 Executed before global request filters.
+ /// &gt;0 Executed after global request filters.
/// </summary>
int Priority { get; }
/// <summary>
/// The request filter is executed before the service.
/// </summary>
- /// <param name="req">The http request wrapper</param>
- /// <param name="res">The http response wrapper</param>
- /// <param name="requestDto">The request DTO</param>
+ /// <param name="req">The http request wrapper.</param>
+ /// <param name="res">The http response wrapper.</param>
+ /// <param name="requestDto">The request DTO.</param>
void RequestFilter(IRequest req, HttpResponse res, object requestDto);
}
}
diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs
index cfa7684c9..3d543039e 100644
--- a/MediaBrowser.Model/System/SystemInfo.cs
+++ b/MediaBrowser.Model/System/SystemInfo.cs
@@ -26,8 +26,6 @@ namespace MediaBrowser.Model.System
/// </summary>
public class SystemInfo : PublicSystemInfo
{
- public PackageVersionClass SystemUpdateLevel { get; set; }
-
/// <summary>
/// Gets or sets the display name of the operating system.
/// </summary>
diff --git a/MediaBrowser.Model/Updates/CheckForUpdateResult.cs b/MediaBrowser.Model/Updates/CheckForUpdateResult.cs
deleted file mode 100644
index be1b08223..000000000
--- a/MediaBrowser.Model/Updates/CheckForUpdateResult.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-namespace MediaBrowser.Model.Updates
-{
- /// <summary>
- /// Class CheckForUpdateResult.
- /// </summary>
- public class CheckForUpdateResult
- {
- /// <summary>
- /// Gets or sets a value indicating whether this instance is update available.
- /// </summary>
- /// <value><c>true</c> if this instance is update available; otherwise, <c>false</c>.</value>
- public bool IsUpdateAvailable { get; set; }
-
- /// <summary>
- /// Gets or sets the available version.
- /// </summary>
- /// <value>The available version.</value>
- public string AvailableVersion
- {
- get => Package != null ? Package.versionStr : "0.0.0.1";
- set { } // need this for the serializer
- }
-
- /// <summary>
- /// Get or sets package information for an available update
- /// </summary>
- public PackageVersionInfo Package { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Updates/InstallationInfo.cs b/MediaBrowser.Model/Updates/InstallationInfo.cs
index 42c2105f5..e0d450d06 100644
--- a/MediaBrowser.Model/Updates/InstallationInfo.cs
+++ b/MediaBrowser.Model/Updates/InstallationInfo.cs
@@ -8,10 +8,10 @@ namespace MediaBrowser.Model.Updates
public class InstallationInfo
{
/// <summary>
- /// Gets or sets the id.
+ /// Gets or sets the guid.
/// </summary>
- /// <value>The id.</value>
- public Guid Id { get; set; }
+ /// <value>The guid.</value>
+ public string Guid { get; set; }
/// <summary>
/// Gets or sets the name.
@@ -20,21 +20,9 @@ namespace MediaBrowser.Model.Updates
public string Name { get; set; }
/// <summary>
- /// Gets or sets the assembly guid.
- /// </summary>
- /// <value>The guid of the assembly.</value>
- public string AssemblyGuid { get; set; }
-
- /// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
public string Version { get; set; }
-
- /// <summary>
- /// Gets or sets the update class.
- /// </summary>
- /// <value>The update class.</value>
- public PackageVersionClass UpdateClass { get; set; }
}
}
diff --git a/MediaBrowser.Model/Updates/PackageInfo.cs b/MediaBrowser.Model/Updates/PackageInfo.cs
index abbe91eff..f5aa8b6fa 100644
--- a/MediaBrowser.Model/Updates/PackageInfo.cs
+++ b/MediaBrowser.Model/Updates/PackageInfo.cs
@@ -9,72 +9,24 @@ namespace MediaBrowser.Model.Updates
public class PackageInfo
{
/// <summary>
- /// The internal id of this package.
- /// </summary>
- /// <value>The id.</value>
- public string id { get; set; }
-
- /// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string name { get; set; }
/// <summary>
- /// Gets or sets the short description.
+ /// Gets or sets a long description of the plugin containing features or helpful explanations.
/// </summary>
- /// <value>The short description.</value>
- public string shortDescription { get; set; }
+ /// <value>The description.</value>
+ public string description { get; set; }
/// <summary>
- /// Gets or sets the overview.
+ /// Gets or sets a short overview of what the plugin does.
/// </summary>
/// <value>The overview.</value>
public string overview { get; set; }
/// <summary>
- /// Gets or sets a value indicating whether this instance is premium.
- /// </summary>
- /// <value><c>true</c> if this instance is premium; otherwise, <c>false</c>.</value>
- public bool isPremium { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is adult only content.
- /// </summary>
- /// <value><c>true</c> if this instance is adult; otherwise, <c>false</c>.</value>
- public bool adult { get; set; }
-
- /// <summary>
- /// Gets or sets the rich desc URL.
- /// </summary>
- /// <value>The rich desc URL.</value>
- public string richDescUrl { get; set; }
-
- /// <summary>
- /// Gets or sets the thumb image.
- /// </summary>
- /// <value>The thumb image.</value>
- public string thumbImage { get; set; }
-
- /// <summary>
- /// Gets or sets the preview image.
- /// </summary>
- /// <value>The preview image.</value>
- public string previewImage { get; set; }
-
- /// <summary>
- /// Gets or sets the type.
- /// </summary>
- /// <value>The type.</value>
- public string type { get; set; }
-
- /// <summary>
- /// Gets or sets the target filename.
- /// </summary>
- /// <value>The target filename.</value>
- public string targetFilename { get; set; }
-
- /// <summary>
/// Gets or sets the owner.
/// </summary>
/// <value>The owner.</value>
@@ -87,90 +39,24 @@ namespace MediaBrowser.Model.Updates
public string category { get; set; }
/// <summary>
- /// Gets or sets the catalog tile color.
- /// </summary>
- /// <value>The owner.</value>
- public string tileColor { get; set; }
-
- /// <summary>
- /// Gets or sets the feature id of this package (if premium).
- /// </summary>
- /// <value>The feature id.</value>
- public string featureId { get; set; }
-
- /// <summary>
- /// Gets or sets the registration info for this package (if premium).
- /// </summary>
- /// <value>The registration info.</value>
- public string regInfo { get; set; }
-
- /// <summary>
- /// Gets or sets the price for this package (if premium).
- /// </summary>
- /// <value>The price.</value>
- public float price { get; set; }
-
- /// <summary>
- /// Gets or sets the target system for this plug-in (Server, MBTheater, MBClassic).
- /// </summary>
- /// <value>The target system.</value>
- public PackageTargetSystem targetSystem { get; set; }
-
- /// <summary>
- /// The guid of the assembly associated with this package (if a plug-in).
+ /// The guid of the assembly associated with this plugin.
/// This is used to identify the proper item for automatic updates.
/// </summary>
/// <value>The name.</value>
public string guid { get; set; }
/// <summary>
- /// Gets or sets the total number of ratings for this package.
- /// </summary>
- /// <value>The total ratings.</value>
- public int? totalRatings { get; set; }
-
- /// <summary>
- /// Gets or sets the average rating for this package .
- /// </summary>
- /// <value>The rating.</value>
- public float avgRating { get; set; }
-
- /// <summary>
- /// Gets or sets whether or not this package is registered.
- /// </summary>
- /// <value>True if registered.</value>
- public bool isRegistered { get; set; }
-
- /// <summary>
- /// Gets or sets the expiration date for this package.
- /// </summary>
- /// <value>Expiration Date.</value>
- public DateTime expDate { get; set; }
-
- /// <summary>
/// Gets or sets the versions.
/// </summary>
/// <value>The versions.</value>
- public IReadOnlyList<PackageVersionInfo> versions { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether [enable in application store].
- /// </summary>
- /// <value><c>true</c> if [enable in application store]; otherwise, <c>false</c>.</value>
- public bool enableInAppStore { get; set; }
-
- /// <summary>
- /// Gets or sets the installs.
- /// </summary>
- /// <value>The installs.</value>
- public int installs { get; set; }
+ public IReadOnlyList<VersionInfo> versions { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="PackageInfo"/> class.
/// </summary>
public PackageInfo()
{
- versions = Array.Empty<PackageVersionInfo>();
+ versions = Array.Empty<VersionInfo>();
}
}
}
diff --git a/MediaBrowser.Model/Updates/PackageTargetSystem.cs b/MediaBrowser.Model/Updates/PackageTargetSystem.cs
deleted file mode 100644
index 11af7f02d..000000000
--- a/MediaBrowser.Model/Updates/PackageTargetSystem.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace MediaBrowser.Model.Updates
-{
- /// <summary>
- /// Enum PackageType.
- /// </summary>
- public enum PackageTargetSystem
- {
- /// <summary>
- /// Server.
- /// </summary>
- Server,
-
- /// <summary>
- /// MB Theater.
- /// </summary>
- MBTheater,
-
- /// <summary>
- /// MB Classic.
- /// </summary>
- MBClassic
- }
-}
diff --git a/MediaBrowser.Model/Updates/PackageVersionClass.cs b/MediaBrowser.Model/Updates/PackageVersionClass.cs
deleted file mode 100644
index f813f2c97..000000000
--- a/MediaBrowser.Model/Updates/PackageVersionClass.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace MediaBrowser.Model.Updates
-{
- /// <summary>
- /// Enum PackageVersionClass.
- /// </summary>
- public enum PackageVersionClass
- {
- /// <summary>
- /// The release.
- /// </summary>
- Release = 0,
-
- /// <summary>
- /// The beta.
- /// </summary>
- Beta = 1,
-
- /// <summary>
- /// The dev.
- /// </summary>
- Dev = 2
- }
-}
diff --git a/MediaBrowser.Model/Updates/PackageVersionInfo.cs b/MediaBrowser.Model/Updates/PackageVersionInfo.cs
deleted file mode 100644
index 3eef965dd..000000000
--- a/MediaBrowser.Model/Updates/PackageVersionInfo.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using System.Text.Json.Serialization;
-
-namespace MediaBrowser.Model.Updates
-{
- /// <summary>
- /// Class PackageVersionInfo.
- /// </summary>
- public class PackageVersionInfo
- {
- /// <summary>
- /// Gets or sets the name.
- /// </summary>
- /// <value>The name.</value>
- public string name { get; set; }
-
- /// <summary>
- /// Gets or sets the guid.
- /// </summary>
- /// <value>The guid.</value>
- public string guid { get; set; }
-
- /// <summary>
- /// Gets or sets the version STR.
- /// </summary>
- /// <value>The version STR.</value>
- public string versionStr { get; set; }
-
- /// <summary>
- /// The _version
- /// </summary>
- private Version _version;
-
- /// <summary>
- /// Gets or sets the version.
- /// Had to make this an interpreted property since Protobuf can't handle Version
- /// </summary>
- /// <value>The version.</value>
- [JsonIgnore]
- public Version Version
- {
- get
- {
- if (_version == null)
- {
- var ver = versionStr;
- _version = new Version(string.IsNullOrEmpty(ver) ? "0.0.0.1" : ver);
- }
-
- return _version;
- }
- }
-
- /// <summary>
- /// Gets or sets the classification.
- /// </summary>
- /// <value>The classification.</value>
- public PackageVersionClass classification { get; set; }
-
- /// <summary>
- /// Gets or sets the description.
- /// </summary>
- /// <value>The description.</value>
- public string description { get; set; }
-
- /// <summary>
- /// Gets or sets the required version STR.
- /// </summary>
- /// <value>The required version STR.</value>
- public string requiredVersionStr { get; set; }
-
- /// <summary>
- /// Gets or sets the source URL.
- /// </summary>
- /// <value>The source URL.</value>
- public string sourceUrl { get; set; }
-
- /// <summary>
- /// Gets or sets the source URL.
- /// </summary>
- /// <value>The source URL.</value>
- public string checksum { get; set; }
-
- /// <summary>
- /// Gets or sets the target filename.
- /// </summary>
- /// <value>The target filename.</value>
- public string targetFilename { get; set; }
-
- public string infoUrl { get; set; }
-
- public string runtimes { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Updates/VersionInfo.cs b/MediaBrowser.Model/Updates/VersionInfo.cs
new file mode 100644
index 000000000..fe5826ad2
--- /dev/null
+++ b/MediaBrowser.Model/Updates/VersionInfo.cs
@@ -0,0 +1,58 @@
+using System;
+
+namespace MediaBrowser.Model.Updates
+{
+ /// <summary>
+ /// Class PackageVersionInfo.
+ /// </summary>
+ public class VersionInfo
+ {
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the guid.
+ /// </summary>
+ /// <value>The guid.</value>
+ public string guid { get; set; }
+
+ /// <summary>
+ /// Gets or sets the version.
+ /// </summary>
+ /// <value>The version.</value>
+ public Version version { get; set; }
+
+ /// <summary>
+ /// Gets or sets the changelog for this version.
+ /// </summary>
+ /// <value>The changelog.</value>
+ public string changelog { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ABI that this version was built against.
+ /// </summary>
+ /// <value>The target ABI version.</value>
+ public string targetAbi { get; set; }
+
+ /// <summary>
+ /// Gets or sets the source URL.
+ /// </summary>
+ /// <value>The source URL.</value>
+ public string sourceUrl { get; set; }
+
+ /// <summary>
+ /// Gets or sets a checksum for the binary.
+ /// </summary>
+ /// <value>The checksum.</value>
+ public string checksum { get; set; }
+
+ /// <summary>
+ /// Gets or sets the target filename for the downloaded binary.
+ /// </summary>
+ /// <value>The target filename.</value>
+ public string filename { get; set; }
+ }
+}