Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Prowlarr/blame/commit/5f93cbc83b61b276f424d4a42f97ad35b9cb64c9/NzbDrone.Core/Update/UpdatePackageProvider.cs You should set ROOT_URL correctly, otherwise the web may not work correctly.
Prowlarr/NzbDrone.Core/Update/UpdatePackageProvider.cs

47 lines
1.4 KiB

using System;
using System.Collections.Generic;
using NzbDrone.Common;
12 years ago
using RestSharp;
using NzbDrone.Core.Rest;
namespace NzbDrone.Core.Update
{
public interface IUpdatePackageProvider
{
12 years ago
UpdatePackage GetLatestUpdate(string branch, Version currentVersion);
List<UpdatePackage> GetRecentUpdates(string branch);
}
public class UpdatePackageProvider : IUpdatePackageProvider
{
12 years ago
public UpdatePackage GetLatestUpdate(string branch, Version currentVersion)
{
12 years ago
var restClient = new RestClient(Services.RootUrl);
12 years ago
var request = new RestRequest("/v1/update/{branch}");
request.AddParameter("version", currentVersion);
request.AddUrlSegment("branch", branch);
var update = restClient.ExecuteAndValidate<UpdatePackageAvailable>(request);
if (!update.Available) return null;
return update.UpdatePackage;
}
public List<UpdatePackage> GetRecentUpdates(string branch)
{
var restClient = new RestClient(Services.RootUrl);
var request = new RestRequest("/v1/update/{branch}/all");
request.AddUrlSegment("branch", branch);
request.AddParameter("limit", 5);
var updates = restClient.ExecuteAndValidate<List<UpdatePackage>>(request);
return updates;
}
}
}