mirror of https://github.com/jellyfin/jellyfin.git
remove release channel from plugin classes
This commit is contained in:
parent
974a04c129
commit
8e9aeb84b1
|
@ -211,19 +211,6 @@ namespace Emby.Server.Implementations
|
||||||
|
|
||||||
public IFileSystem FileSystemManager { get; set; }
|
public IFileSystem FileSystemManager { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public ReleaseChannel SystemUpdateLevel
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
#if NIGHTLY
|
|
||||||
return PackageChannel.Nightly;
|
|
||||||
#else
|
|
||||||
return ReleaseChannel.Stable;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the service provider.
|
/// Gets or sets the service provider.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1416,7 +1403,6 @@ namespace Emby.Server.Implementations
|
||||||
SupportsLibraryMonitor = true,
|
SupportsLibraryMonitor = true,
|
||||||
EncoderLocation = MediaEncoder.EncoderLocation,
|
EncoderLocation = MediaEncoder.EncoderLocation,
|
||||||
SystemArchitecture = RuntimeInformation.OSArchitecture,
|
SystemArchitecture = RuntimeInformation.OSArchitecture,
|
||||||
SystemUpdateLevel = SystemUpdateLevel,
|
|
||||||
PackageName = StartupOptions.PackageName
|
PackageName = StartupOptions.PackageName
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,13 +150,11 @@ namespace Emby.Server.Implementations.Updates
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IEnumerable<VersionInfo> GetCompatibleVersions(
|
public IEnumerable<VersionInfo> GetCompatibleVersions(
|
||||||
IEnumerable<VersionInfo> availableVersions,
|
IEnumerable<VersionInfo> availableVersions,
|
||||||
Version minVersion = null,
|
Version minVersion = null)
|
||||||
ReleaseChannel releaseChannel = ReleaseChannel.Stable)
|
|
||||||
{
|
{
|
||||||
var appVer = _applicationHost.ApplicationVersion;
|
var appVer = _applicationHost.ApplicationVersion;
|
||||||
availableVersions = availableVersions
|
availableVersions = availableVersions
|
||||||
.Where(x => x.channel == releaseChannel
|
.Where(x => Version.Parse(x.minimumServerVersion) <= appVer);
|
||||||
&& Version.Parse(x.minimumServerVersion) <= appVer);
|
|
||||||
|
|
||||||
if (minVersion != null)
|
if (minVersion != null)
|
||||||
{
|
{
|
||||||
|
@ -171,8 +169,7 @@ namespace Emby.Server.Implementations.Updates
|
||||||
IEnumerable<PackageInfo> availablePackages,
|
IEnumerable<PackageInfo> availablePackages,
|
||||||
string name = null,
|
string name = null,
|
||||||
Guid guid = default,
|
Guid guid = default,
|
||||||
Version minVersion = null,
|
Version minVersion = null)
|
||||||
ReleaseChannel releaseChannel = ReleaseChannel.Stable)
|
|
||||||
{
|
{
|
||||||
var package = FilterPackages(availablePackages, name, guid).FirstOrDefault();
|
var package = FilterPackages(availablePackages, name, guid).FirstOrDefault();
|
||||||
|
|
||||||
|
@ -184,8 +181,7 @@ namespace Emby.Server.Implementations.Updates
|
||||||
|
|
||||||
return GetCompatibleVersions(
|
return GetCompatibleVersions(
|
||||||
package.versions,
|
package.versions,
|
||||||
minVersion,
|
minVersion);
|
||||||
releaseChannel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
@ -193,12 +189,10 @@ namespace Emby.Server.Implementations.Updates
|
||||||
{
|
{
|
||||||
var catalog = await GetAvailablePackages(cancellationToken).ConfigureAwait(false);
|
var catalog = await GetAvailablePackages(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
var systemUpdateLevel = _applicationHost.SystemUpdateLevel;
|
|
||||||
|
|
||||||
// Figure out what needs to be installed
|
// Figure out what needs to be installed
|
||||||
foreach (var plugin in _applicationHost.Plugins)
|
foreach (var plugin in _applicationHost.Plugins)
|
||||||
{
|
{
|
||||||
var compatibleVersions = GetCompatibleVersions(catalog, plugin.Name, plugin.Id, plugin.Version, systemUpdateLevel);
|
var compatibleVersions = GetCompatibleVersions(catalog, plugin.Name, plugin.Id, plugin.Version);
|
||||||
var version = compatibleVersions.FirstOrDefault(y => y.versionCode > plugin.Version);
|
var version = compatibleVersions.FirstOrDefault(y => y.versionCode > plugin.Version);
|
||||||
if (version != null
|
if (version != null
|
||||||
&& !CompletedInstallations.Any(x => string.Equals(x.AssemblyGuid, version.guid, StringComparison.OrdinalIgnoreCase)))
|
&& !CompletedInstallations.Any(x => string.Equals(x.AssemblyGuid, version.guid, StringComparison.OrdinalIgnoreCase)))
|
||||||
|
@ -221,7 +215,6 @@ namespace Emby.Server.Implementations.Updates
|
||||||
Id = Guid.NewGuid(),
|
Id = Guid.NewGuid(),
|
||||||
Name = package.name,
|
Name = package.name,
|
||||||
AssemblyGuid = package.guid,
|
AssemblyGuid = package.guid,
|
||||||
UpdateClass = package.channel,
|
|
||||||
Version = package.versionString
|
Version = package.versionString
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -313,13 +306,13 @@ namespace Emby.Server.Implementations.Updates
|
||||||
// Do plugin-specific processing
|
// Do plugin-specific processing
|
||||||
if (plugin == null)
|
if (plugin == null)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("New plugin installed: {0} {1} {2}", package.name, package.versionString ?? string.Empty, package.channel);
|
_logger.LogInformation("New plugin installed: {0} {1} {2}", package.name, package.versionString ?? string.Empty);
|
||||||
|
|
||||||
PluginInstalled?.Invoke(this, new GenericEventArgs<VersionInfo>(package));
|
PluginInstalled?.Invoke(this, new GenericEventArgs<VersionInfo>(package));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Plugin updated: {0} {1} {2}", package.name, package.versionString ?? string.Empty, package.channel);
|
_logger.LogInformation("Plugin updated: {0} {1} {2}", package.name, package.versionString ?? string.Empty);
|
||||||
|
|
||||||
PluginUpdated?.Invoke(this, new GenericEventArgs<(IPlugin, VersionInfo)>((plugin, package)));
|
PluginUpdated?.Invoke(this, new GenericEventArgs<(IPlugin, VersionInfo)>((plugin, package)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,13 +71,6 @@ namespace MediaBrowser.Api
|
||||||
/// <value>The version.</value>
|
/// <value>The version.</value>
|
||||||
[ApiMember(Name = "Version", Description = "Optional version. Defaults to latest version.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
|
[ApiMember(Name = "Version", Description = "Optional version. Defaults to latest version.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
|
||||||
public string Version { get; set; }
|
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 ReleaseChannel UpdateClass { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -152,8 +145,7 @@ namespace MediaBrowser.Api
|
||||||
packages,
|
packages,
|
||||||
request.Name,
|
request.Name,
|
||||||
string.IsNullOrEmpty(request.AssemblyGuid) ? Guid.Empty : Guid.Parse(request.AssemblyGuid),
|
string.IsNullOrEmpty(request.AssemblyGuid) ? Guid.Empty : Guid.Parse(request.AssemblyGuid),
|
||||||
string.IsNullOrEmpty(request.Version) ? null : Version.Parse(request.Version),
|
string.IsNullOrEmpty(request.Version) ? null : Version.Parse(request.Version)).FirstOrDefault();
|
||||||
request.UpdateClass).FirstOrDefault();
|
|
||||||
|
|
||||||
if (package == null)
|
if (package == null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,12 +47,6 @@ namespace MediaBrowser.Common
|
||||||
/// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
|
/// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
|
||||||
bool CanSelfRestart { get; }
|
bool CanSelfRestart { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the version class of the system.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><see cref="ReleaseChannel.Stable" /> or <see cref="ReleaseChannel.Nightly" />.</value>
|
|
||||||
ReleaseChannel SystemUpdateLevel { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the application version.
|
/// Gets the application version.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -65,12 +65,10 @@ namespace MediaBrowser.Common.Updates
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="availableVersions">The available version of the plugin.</param>
|
/// <param name="availableVersions">The available version of the plugin.</param>
|
||||||
/// <param name="minVersion">The minimum required version of the plugin.</param>
|
/// <param name="minVersion">The minimum required version of the plugin.</param>
|
||||||
/// <param name="releaseChannel">The classification of updates.</param>
|
|
||||||
/// <returns>All compatible versions ordered from newest to oldest.</returns>
|
/// <returns>All compatible versions ordered from newest to oldest.</returns>
|
||||||
IEnumerable<VersionInfo> GetCompatibleVersions(
|
IEnumerable<VersionInfo> GetCompatibleVersions(
|
||||||
IEnumerable<VersionInfo> availableVersions,
|
IEnumerable<VersionInfo> availableVersions,
|
||||||
Version minVersion = null,
|
Version minVersion = null);
|
||||||
ReleaseChannel releaseChannel = ReleaseChannel.Stable);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns all compatible versions ordered from newest to oldest.
|
/// Returns all compatible versions ordered from newest to oldest.
|
||||||
|
@ -79,14 +77,12 @@ namespace MediaBrowser.Common.Updates
|
||||||
/// <param name="name">The name.</param>
|
/// <param name="name">The name.</param>
|
||||||
/// <param name="guid">The guid of the plugin.</param>
|
/// <param name="guid">The guid of the plugin.</param>
|
||||||
/// <param name="minVersion">The minimum required version of the plugin.</param>
|
/// <param name="minVersion">The minimum required version of the plugin.</param>
|
||||||
/// <param name="releaseChannel">The classification.</param>
|
|
||||||
/// <returns>All compatible versions ordered from newest to oldest.</returns>
|
/// <returns>All compatible versions ordered from newest to oldest.</returns>
|
||||||
IEnumerable<VersionInfo> GetCompatibleVersions(
|
IEnumerable<VersionInfo> GetCompatibleVersions(
|
||||||
IEnumerable<PackageInfo> availablePackages,
|
IEnumerable<PackageInfo> availablePackages,
|
||||||
string name = null,
|
string name = null,
|
||||||
Guid guid = default,
|
Guid guid = default,
|
||||||
Version minVersion = null,
|
Version minVersion = null);
|
||||||
ReleaseChannel releaseChannel = ReleaseChannel.Stable);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the available plugin updates.
|
/// Returns the available plugin updates.
|
||||||
|
|
|
@ -9,17 +9,17 @@ namespace MediaBrowser.Model.Services
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Order in which Request Filters are executed.
|
/// Order in which Request Filters are executed.
|
||||||
/// <0 Executed before global request filters
|
/// <0 Executed before global request filters.
|
||||||
/// >0 Executed after global request filters
|
/// >0 Executed after global request filters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int Priority { get; }
|
int Priority { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The request filter is executed before the service.
|
/// The request filter is executed before the service.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="req">The http request wrapper</param>
|
/// <param name="req">The http request wrapper.</param>
|
||||||
/// <param name="res">The http response wrapper</param>
|
/// <param name="res">The http response wrapper.</param>
|
||||||
/// <param name="requestDto">The request DTO</param>
|
/// <param name="requestDto">The request DTO.</param>
|
||||||
void RequestFilter(IRequest req, HttpResponse res, object requestDto);
|
void RequestFilter(IRequest req, HttpResponse res, object requestDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,6 @@ namespace MediaBrowser.Model.System
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SystemInfo : PublicSystemInfo
|
public class SystemInfo : PublicSystemInfo
|
||||||
{
|
{
|
||||||
public ReleaseChannel SystemUpdateLevel { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the display name of the operating system.
|
/// Gets or sets the display name of the operating system.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -30,11 +30,5 @@ namespace MediaBrowser.Model.Updates
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The version.</value>
|
/// <value>The version.</value>
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the update class.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The update class.</value>
|
|
||||||
public ReleaseChannel UpdateClass { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
namespace MediaBrowser.Model.Updates
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Enum PackageVersionClass.
|
|
||||||
/// </summary>
|
|
||||||
public enum ReleaseChannel
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The stable.
|
|
||||||
/// </summary>
|
|
||||||
Stable = 0,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The nightly.
|
|
||||||
/// </summary>
|
|
||||||
Nightly = 1
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -34,12 +34,6 @@ namespace MediaBrowser.Model.Updates
|
||||||
/// <value>The version.</value>
|
/// <value>The version.</value>
|
||||||
public Version versionCode { get; set; }
|
public Version versionCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the release channel.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The release channel for a given package version.</value>
|
|
||||||
public ReleaseChannel channel { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the description.
|
/// Gets or sets the description.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue