2013-11-20 03:42:17 +03:00
|
|
|
using System.Collections.Generic;
|
2015-02-07 16:56:36 +02:00
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
2013-09-28 21:48:30 +03:00
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Update
|
|
|
|
{
|
|
|
|
public interface IRecentUpdateProvider
|
|
|
|
{
|
|
|
|
List<UpdatePackage> GetRecentUpdatePackages();
|
|
|
|
}
|
|
|
|
|
|
|
|
public class RecentUpdateProvider : IRecentUpdateProvider
|
|
|
|
{
|
|
|
|
private readonly IConfigFileProvider _configFileProvider;
|
|
|
|
private readonly IUpdatePackageProvider _updatePackageProvider;
|
|
|
|
|
|
|
|
public RecentUpdateProvider(IConfigFileProvider configFileProvider,
|
|
|
|
IUpdatePackageProvider updatePackageProvider)
|
|
|
|
{
|
|
|
|
_configFileProvider = configFileProvider;
|
|
|
|
_updatePackageProvider = updatePackageProvider;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<UpdatePackage> GetRecentUpdatePackages()
|
|
|
|
{
|
|
|
|
var branch = _configFileProvider.Branch;
|
2015-02-07 16:56:36 +02:00
|
|
|
return _updatePackageProvider.GetRecentUpdates(branch, BuildInfo.Version);
|
2013-09-28 21:48:30 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|