From 797f099a6c4a7c7e70b50bfd3e9bd9d450a5b3d9 Mon Sep 17 00:00:00 2001 From: dexagod Date: Sat, 31 Dec 2022 02:46:24 +0100 Subject: [PATCH] Fix: Fixed issue where listings are not shown if no additional metadata is present for them in the container rdf data --- src/utils/util.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/util.ts b/src/utils/util.ts index a38eac4..0aef603 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -345,6 +345,12 @@ export function getResourceInfoFromDataset(dataset: SolidDataset, resourceUrl: s isDir: types.indexOf('http://www.w3.org/ns/ldp#Container') !== -1 || types.indexOf('http://www.w3.org/ns/ldp#BasicContainer') !== -1, modified, mtime, size, types } + } else { + resourceInfo = { + url: resourceUrl, + relativePath: baseUrl ? resourceUrl.slice(baseUrl.length) : undefined, + isDir: resourceUrl.endsWith('/') // Note: it might be best to dereference the URL to check for sure, but this saves an extra request. + } } return resourceInfo }