Fix /filterResources endpoint

This commit is contained in:
jvyden 2021-10-21 19:14:20 -04:00
commit 6266d3907b
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
3 changed files with 3 additions and 6 deletions

View file

@ -1,6 +1,4 @@
using System.Buffers;
using System.IO;
using System.IO.Pipelines;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Serialization;
@ -32,11 +30,11 @@ namespace LBPUnion.ProjectLighthouse.Controllers {
if(resourceList == null) return this.BadRequest();
string resources = resourceList.Resources
.Where(FileHelper.ResourceExists)
.Where(s => !FileHelper.ResourceExists(s))
.Aggregate("", (current, hash) =>
current + LbpSerializer.StringElement("resource", hash));
return this.Ok(resources);
return this.Ok(LbpSerializer.StringElement("resources", resources));
}
[HttpGet("r/{hash}")]

View file

@ -1,4 +1,3 @@
using System.IO;
using LBPUnion.ProjectLighthouse.Helpers;
namespace LBPUnion.ProjectLighthouse.Types.Files {

View file

@ -1,7 +1,7 @@
using System.Xml.Serialization;
namespace LBPUnion.ProjectLighthouse.Types {
[XmlRoot("resource"), XmlType("resources")]
[XmlRoot("resources"), XmlType("resources")]
public class ResourceList {
[XmlElement("resource")]
public string[] Resources;