Commit 6c00786c authored by Benedikt Heinrichs's avatar Benedikt Heinrichs Committed by Hanna Führ
Browse files

Fix: Metadata can be retrieved without a file present (coscine/issues#2122)

parent 85f83546
......@@ -157,6 +157,12 @@ namespace Coscine.Api.Tree.Controllers
var resourceTypeInformation = resourceTypeDefinition.GetResourceTypeInformation().Result;
var metadataInfos = new List<ResourceEntry>(fileInfos);
// Add to metadata infos, if no "physical" file for it exists
if (!metadataInfos.Any((metadataInfo) => metadataInfo.Key == path))
metadataInfos.Add(new ResourceEntry(path, true, 0, GenerateId(resourceId, path).AbsoluteUri, null, DateTime.Now, DateTime.Now));
var graphs = new List<object>();
int metadataCount = 0;
foreach (var info in metadataInfos)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment