mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
fixing update for vnext.
This commit is contained in:
parent
2001e5f502
commit
80c996c216
31 changed files with 279 additions and 175 deletions
39
NzbDrone.Api/Update/UpdateModule.cs
Normal file
39
NzbDrone.Api/Update/UpdateModule.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Api.REST;
|
||||
using NzbDrone.Core.Update;
|
||||
using NzbDrone.Api.Mapping;
|
||||
|
||||
namespace NzbDrone.Api.Update
|
||||
{
|
||||
public class UpdateModule : NzbDroneRestModule<UpdateResource>
|
||||
{
|
||||
private readonly IUpdateService _updateService;
|
||||
|
||||
public UpdateModule(IUpdateService updateService)
|
||||
{
|
||||
_updateService = updateService;
|
||||
GetResourceAll = GetAvailableUpdate;
|
||||
}
|
||||
|
||||
private List<UpdateResource> GetAvailableUpdate()
|
||||
{
|
||||
var update = _updateService.AvailableUpdate();
|
||||
var response = new List<UpdateResource>();
|
||||
|
||||
if (update != null)
|
||||
{
|
||||
response.Add(update.InjectTo<UpdateResource>());
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
public class UpdateResource : RestResource
|
||||
{
|
||||
public Version Version { get; set; }
|
||||
public String FileName { get; set; }
|
||||
public String Url { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue