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

MediaProcessing(uid, file_id[, db_session])

Media Processing

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(meta)

metadata and scaling for still images

Parameters

meta (dict) – Image metadata

video(meta)

metadata for videos - construct and save a pictures db record

Parameters

meta (dict) – Video metadata