mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Merge pull request #3577 from crobibero/package-install-repo
Specify plugin repo on plugin installation
This commit is contained in:
commit
cbf9be9416
@ -155,7 +155,12 @@ namespace Emby.Server.Implementations.Updates
|
||||
var result = new List<PackageInfo>();
|
||||
foreach (RepositoryInfo repository in _config.Configuration.PluginRepositories)
|
||||
{
|
||||
result.AddRange(await GetPackages(repository.Url, cancellationToken).ConfigureAwait(true));
|
||||
foreach (var package in await GetPackages(repository.Url, cancellationToken).ConfigureAwait(true))
|
||||
{
|
||||
package.repositoryName = repository.Name;
|
||||
package.repositoryUrl = repository.Url;
|
||||
result.Add(package);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -77,6 +77,7 @@ namespace Jellyfin.Api.Controllers
|
||||
/// <param name="name">Package name.</param>
|
||||
/// <param name="assemblyGuid">GUID of the associated assembly.</param>
|
||||
/// <param name="version">Optional version. Defaults to latest version.</param>
|
||||
/// <param name="repositoryUrl">Optional. Specify the repository to install from.</param>
|
||||
/// <response code="204">Package found.</response>
|
||||
/// <response code="404">Package not found.</response>
|
||||
/// <returns>A <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if the package could not be found.</returns>
|
||||
@ -87,9 +88,16 @@ namespace Jellyfin.Api.Controllers
|
||||
public async Task<ActionResult> InstallPackage(
|
||||
[FromRoute, Required] string name,
|
||||
[FromQuery] string? assemblyGuid,
|
||||
[FromQuery] string? version)
|
||||
[FromQuery] string? version,
|
||||
[FromQuery] string? repositoryUrl)
|
||||
{
|
||||
var packages = await _installationManager.GetAvailablePackages().ConfigureAwait(false);
|
||||
if (!string.IsNullOrEmpty(repositoryUrl))
|
||||
{
|
||||
packages = packages.Where(p => p.repositoryUrl.Equals(repositoryUrl, StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
var package = _installationManager.GetCompatibleVersions(
|
||||
packages,
|
||||
name,
|
||||
|
@ -52,6 +52,16 @@ namespace MediaBrowser.Model.Updates
|
||||
/// <value>The versions.</value>
|
||||
public IReadOnlyList<VersionInfo> versions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the repository name.
|
||||
/// </summary>
|
||||
public string repositoryName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the repository url.
|
||||
/// </summary>
|
||||
public string repositoryUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PackageInfo"/> class.
|
||||
/// </summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user