New: Show previously installed version in Updates UI

Co-Authored-By: Taloth <Taloth@users.noreply.github.com>
This commit is contained in:
Qstick
2021-01-24 23:33:54 -05:00
parent e3a4cd8b19
commit 86eeb3cc57
19 changed files with 374 additions and 11 deletions
@@ -11,7 +11,7 @@ namespace NzbDrone.Core.Update
public interface IUpdatePackageProvider
{
UpdatePackage GetLatestUpdate(string branch, Version currentVersion);
List<UpdatePackage> GetRecentUpdates(string branch, Version currentVersion);
List<UpdatePackage> GetRecentUpdates(string branch, Version currentVersion, Version previousVersion = null);
}
public class UpdatePackageProvider : IUpdatePackageProvider
@@ -56,7 +56,7 @@ namespace NzbDrone.Core.Update
return update.UpdatePackage;
}
public List<UpdatePackage> GetRecentUpdates(string branch, Version currentVersion)
public List<UpdatePackage> GetRecentUpdates(string branch, Version currentVersion, Version previousVersion)
{
var request = _requestBuilder.Create()
.Resource("/update/{branch}/changes")
@@ -67,6 +67,11 @@ namespace NzbDrone.Core.Update
.AddQueryParam("runtimeVer", _platformInfo.Version)
.SetSegment("branch", branch);
if (previousVersion != null && previousVersion != currentVersion)
{
request.AddQueryParam("prevVersion", previousVersion);
}
if (_analyticsService.IsEnabled)
{
// Send if the system is active so we know which versions to deprecate/ignore