2013-06-28 00:04:52 +00:00
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
2013-09-11 06:33:47 +00:00
|
|
|
using NzbDrone.Core.Configuration;
|
2013-06-28 00:04:52 +00:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Update
|
|
|
|
{
|
|
|
|
public interface ICheckUpdateService
|
|
|
|
{
|
|
|
|
UpdatePackage AvailableUpdate();
|
|
|
|
}
|
|
|
|
|
|
|
|
public class CheckUpdateService : ICheckUpdateService
|
|
|
|
{
|
|
|
|
private readonly IUpdatePackageProvider _updatePackageProvider;
|
2013-09-11 06:33:47 +00:00
|
|
|
private readonly IConfigFileProvider _configFileProvider;
|
2013-06-28 00:04:52 +00:00
|
|
|
|
2014-04-28 06:34:29 +00:00
|
|
|
public CheckUpdateService(IUpdatePackageProvider updatePackageProvider,
|
2018-04-21 04:59:31 +00:00
|
|
|
IConfigFileProvider configFileProvider)
|
2013-06-28 00:04:52 +00:00
|
|
|
{
|
|
|
|
_updatePackageProvider = updatePackageProvider;
|
2013-09-11 06:33:47 +00:00
|
|
|
_configFileProvider = configFileProvider;
|
2013-06-28 00:04:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public UpdatePackage AvailableUpdate()
|
|
|
|
{
|
2017-01-08 18:42:46 +00:00
|
|
|
return _updatePackageProvider.GetLatestUpdate(_configFileProvider.Branch, BuildInfo.Version);
|
2013-06-28 00:04:52 +00:00
|
|
|
}
|
|
|
|
}
|
2019-12-22 21:24:10 +00:00
|
|
|
}
|