storage/get+discover: only add items not exceeding max-resource-size
This commit is contained in:
@@ -77,6 +77,7 @@ class StoragePartDiscover(StorageBase):
|
|||||||
if href:
|
if href:
|
||||||
item = collection._get(href)
|
item = collection._get(href)
|
||||||
if item is not None:
|
if item is not None:
|
||||||
|
if pathutils.file_check_size(filesystem_path, self._max_resource_size):
|
||||||
yield item
|
yield item
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ class CollectionPartGet(CollectionPartCache, CollectionPartLock,
|
|||||||
href)
|
href)
|
||||||
yield (href, None)
|
yield (href, None)
|
||||||
else:
|
else:
|
||||||
|
if pathutils.file_check_size(path, self._storage._max_resource_size):
|
||||||
yield (href, self._get(href, verify_href=False))
|
yield (href, self._get(href, verify_href=False))
|
||||||
|
|
||||||
def get_all(self) -> Iterator[radicale_item.Item]:
|
def get_all(self) -> Iterator[radicale_item.Item]:
|
||||||
@@ -183,4 +184,5 @@ class CollectionPartGet(CollectionPartCache, CollectionPartLock,
|
|||||||
# are from os.listdir.
|
# are from os.listdir.
|
||||||
item = self._get(href, verify_href=False)
|
item = self._get(href, verify_href=False)
|
||||||
if item is not None:
|
if item is not None:
|
||||||
|
if pathutils.file_check_size(os.path.join(self._filesystem_path, href), self._storage._max_resource_size):
|
||||||
yield item
|
yield item
|
||||||
|
|||||||
Reference in New Issue
Block a user