diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2019-08-17 15:17:02 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2019-08-17 15:19:36 +0200 |
commit | 13d38291bd07401bd16b6e6805edc72bf0029b2f (patch) | |
tree | 2f550185745df9ffb219b468fc1e33447b5a7a22 /fbin/file_storage/base.py | |
parent | ce47bae559df59be8d8b2016cefa62c2fa00d0e2 (diff) |
Fetch and store thumbnails via storage modules
This will allow us to remotely store thumbnails in case of S3. For S3
the thumb bucket is configurable to allow these to be stored separately.
The S3 key for thumbnails does not conflict with files, so these can be
stored in the same bucket if needed.
Diffstat (limited to 'fbin/file_storage/base.py')
-rw-r--r-- | fbin/file_storage/base.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fbin/file_storage/base.py b/fbin/file_storage/base.py index 6f39665..9f09199 100644 --- a/fbin/file_storage/base.py +++ b/fbin/file_storage/base.py @@ -37,3 +37,12 @@ class BaseStorage: This is used internally for eg. thumbnails.''' raise NotImplementedError() + def get_thumbnail(self, f): + '''Return a file object for the specified file's thumbnail. + + Subclasses can also return a flask.Response instance if required.''' + raise NotImplementedError() + + def store_thumbnail(self, f, stream): + '''Store thumbnail for the specified file.''' + raise NotImplementedError() |