diff --git a/asab/library/service.py b/asab/library/service.py index 5d595d9b..7e7d9696 100644 --- a/asab/library/service.py +++ b/asab/library/service.py @@ -473,10 +473,14 @@ async def get_item_metadata(self, path: str) -> typing.Optional[dict]: if not directory or not filename: L.warning("Invalid path '{}': missing directory or filename.".format(path)) return None + # Ensure directory ends with '/' + if not directory.endswith('/'): + directory += '/' try: # Fetch all items in the directory - items = await self.list("/") + items = await self.list(directory) + print(items) except Exception as e: L.warning("Failed to list items in directory '{}': {}".format(directory, e)) return None