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 { private readonly ICheckUpdateService _checkUpdateService; public UpdateModule(ICheckUpdateService checkUpdateService) { _checkUpdateService = checkUpdateService; GetResourceAll = GetAvailableUpdate; } private List GetAvailableUpdate() { var update = _checkUpdateService.AvailableUpdate(); var response = new List(); if (update != null) { response.Add(update.InjectTo()); } return response; } } public class UpdateResource : RestResource { public Version Version { get; set; } public String FileName { get; set; } public String Url { get; set; } } }