summaryrefslogtreecommitdiff
path: root/src/home/media
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-06-14 23:49:20 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-06-14 23:49:20 +0300
commite1d8a4eb86d3b4696d7679e5ded8ac036939c644 (patch)
treef921fcb6644a8f759d39f8638ac5ccb1c966e5d0 /src/home/media
parent086a0960a3f4f4663af704c086e8195f380b15c1 (diff)
camera_node: workaround for storage logic for esp32-cam based cam
Diffstat (limited to 'src/home/media')
-rw-r--r--src/home/media/__init__.py2
-rw-r--r--src/home/media/__init__.pyi2
-rw-r--r--src/home/media/storage.py13
3 files changed, 13 insertions, 4 deletions
diff --git a/src/home/media/__init__.py b/src/home/media/__init__.py
index e8268cf..976c990 100644
--- a/src/home/media/__init__.py
+++ b/src/home/media/__init__.py
@@ -6,7 +6,7 @@ __map__ = {
'record_client': ['SoundRecordClient', 'CameraRecordClient', 'RecordClient'],
'node_server': ['MediaNodeServer'],
'node_client': ['SoundNodeClient', 'CameraNodeClient', 'MediaNodeClient'],
- 'storage': ['SoundRecordStorage', 'CameraRecordStorage', 'SoundRecordFile', 'CameraRecordFile', 'RecordFile'],
+ 'storage': ['SoundRecordStorage', 'ESP32CameraRecordStorage', 'SoundRecordFile', 'CameraRecordFile', 'RecordFile'],
'record': ['SoundRecorder', 'CameraRecorder']
}
diff --git a/src/home/media/__init__.pyi b/src/home/media/__init__.pyi
index 0e85cde..77c2176 100644
--- a/src/home/media/__init__.pyi
+++ b/src/home/media/__init__.pyi
@@ -16,7 +16,7 @@ from .node_client import (
)
from .storage import (
SoundRecordStorage as SoundRecordStorage,
- CameraRecordStorage as CameraRecordStorage,
+ ESP32CameraRecordStorage as ESP32CameraRecordStorage,
SoundRecordFile as SoundRecordFile,
CameraRecordFile as CameraRecordFile,
RecordFile as RecordFile
diff --git a/src/home/media/storage.py b/src/home/media/storage.py
index 880b899..5c41981 100644
--- a/src/home/media/storage.py
+++ b/src/home/media/storage.py
@@ -116,6 +116,13 @@ class RecordFile:
}
+class PseudoRecordFile(RecordFile):
+ EXTENSION = 'null'
+
+ def __init__(self):
+ super().__init__('/pseudo/file')
+
+
class SoundRecordFile(RecordFile):
EXTENSION = 'mp3'
@@ -192,6 +199,8 @@ class SoundRecordStorage(RecordStorage):
EXTENSION = 'mp3'
-class CameraRecordStorage(RecordStorage):
- EXTENSION = 'mp4'
+class ESP32CameraRecordStorage(RecordStorage):
+ EXTENSION = 'jpg' # not used anyway
+ def save(self, *args, **kwargs):
+ return PseudoRecordFile() \ No newline at end of file