From f33f7e7181db35c25775b2a2a4402c3424475ec1 Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Sat, 26 Apr 2025 15:43:09 +0000 Subject: [PATCH] fix: remove abstractmethod from scan method in BaseStorage --- api/extensions/storage/base_storage.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api/extensions/storage/base_storage.py b/api/extensions/storage/base_storage.py index 7c7316a107..0393206e54 100644 --- a/api/extensions/storage/base_storage.py +++ b/api/extensions/storage/base_storage.py @@ -31,6 +31,10 @@ class BaseStorage(ABC): def delete(self, filename): raise NotImplementedError - @abstractmethod - def scan(self, path, files, directories) -> list[str]: - raise NotImplementedError + def scan(self, path, files=True, directories=False) -> list[str]: + """ + Scan files and directories in the given path. + This method is implemented only in some storage backends. + If a storage backend doesn't support scanning, it will raise NotImplementedError. + """ + raise NotImplementedError("This storage backend doesn't support scanning")