diff --git a/unifi_protect_backup/utils.py b/unifi_protect_backup/utils.py index 0f06ca8..0171c5c 100644 --- a/unifi_protect_backup/utils.py +++ b/unifi_protect_backup/utils.py @@ -160,6 +160,11 @@ class VideoQueue(asyncio.Queue): Put an item into the queue. If the queue is full, wait until a free slot is available before adding item. """ + if len(item[1]) > self._maxsize: + raise ValueError( + f"Item is larger ({human_readable_size(len(item[1]))}) than the size of the buffer ({human_readable_size(self._maxsize)})" + ) + while self.full(item): putter = self._loop.create_future() self._putters.append(putter)