apicrud.media.worker_processing¶
worker_processing.py
- Media worker functions to process media
Uploaded videos and photos contain metadata fields that we can parse and store in the database (plus the redis cache). Various sizes of images need to be sent to the storage API for quick retrieval; these functions are the background engine for such longer-running tasks.
created 3-feb-2020 by richb@instantlinux.net
Classes
|
Media Processing |
Exceptions
-
class
apicrud.media.worker_processing.
MediaProcessing
(uid, file_id, db_session=None)¶ Media Processing
-
uid
¶ User ID
- Type
str
-
file_id
¶ ID of record in File model
- Type
str
-
db_session
¶ database session
- Type
obj
-
photo
(uid, meta, db_session)¶ metadata and scaling for still images
- Parameters
uid (str) – User ID
meta (dict) – Image metadata
db_session (obj) – database session
-
video
(uid, meta, db_session)¶ metadata for videos - construct and save a pictures db record
- Parameters
uid (str) – User ID
meta (dict) – Video metadata
db_session (obj) – database session
-
-
exception
apicrud.media.worker_processing.
MediaUploadException
¶