New: Update Nancy to 2.0

This commit is contained in:
ta264 2019-09-12 21:32:51 +01:00
parent 425bd8964f
commit 17c9fc419c
44 changed files with 266 additions and 266 deletions

View file

@ -32,8 +32,8 @@ namespace Lidarr.Api.V1.System.Backup
GetResourceAll = GetBackupFiles;
DeleteResource = DeleteBackup;
Post[@"/restore/(?<id>[\d]{1,10})"] = x => Restore((int)x.Id);
Post["/restore/upload"] = x => UploadAndRestore();
Post(@"/restore/(?<id>[\d]{1,10})", x => Restore((int)x.Id));
Post("/restore/upload", x => UploadAndRestore());
}
public List<BackupResource> GetBackupFiles()
@ -65,7 +65,7 @@ namespace Lidarr.Api.V1.System.Backup
_diskProvider.DeleteFile(path);
}
public Response Restore(int id)
public object Restore(int id)
{
var backup = GetBackup(id);
@ -81,10 +81,10 @@ namespace Lidarr.Api.V1.System.Backup
return new
{
RestartRequired = true
}.AsResponse();
};
}
public Response UploadAndRestore()
public object UploadAndRestore()
{
var files = Context.Request.Files.ToList();
@ -112,7 +112,7 @@ namespace Lidarr.Api.V1.System.Backup
return new
{
RestartRequired = true
}.AsResponse();
};
}
private string GetBackupPath(NzbDrone.Core.Backup.Backup backup)