Periodic tasks

Periodic tasks perform recurring actions triggered either by intervals or crontabs.

medialoopster administration → DJCelery → Periodic tasks

Add Periodic Task

When you add a new periodic task give it a name, choose a registered or enter a custom task and keep the checkbox "enabled" checked. To schedule the task give either an interval or a cron time format. You might add JSON encoded positional arguments or JSON encoded keyword arguments to the task (the latter are preferred, to be able to leave out the arguments left to default). And finally you may optionally set the expiration date, a tasks queue, a message broker exchange and a message broker routing key.

It is preferred to disable the task rather than deleting it.

Setting up watchfolders

Common applications of periodic tasks are so-called watchfolders. There are two different kinds of watchfolder tasks in medialoopster. All of them are configured by setting JSON encoded keyword arguments in the medialoopster administration interface.

Configuration example of keyword arguments
{
	"path": "/mnt/medialoopster/Watchfolder/Import/",
	"production_name": "nachtblau",
	"accepted_ext": [".mov", ".mxf", ".mp4", ".mpeg", ".flv"],
	"last_modified_limit": 30,
	"auto_detect_shots": true,
	"target_path": "/mnt/medialoopster/Highres/Video/"
}

browser.tasks.scan_folder

This is the standard watchfolder task. It scans a folder for files and creates new assets from accepted files. In general a file is considered as "accepted" when the following criteria are met:

  1. File is not empty (size > 0)
  2. File has not been modified recently (see option last_modified_limit)
  3. File name does not start with a period (.) or underscore (_)
  4. File extension is in the list of accepted file extensions (see option accepted_ext)

Options

NameRequiredDescription
pathyesAbsolute path of the folder to scan, as seen by medialoopster.
production_nameyesName of the target production to assign the new asset to.
accepted_extnoList of accepted file extensions. If not set, the default file extensions from settings.VIDEO_EXT, settings.AUDIO_EXT and settings.IMAGE_EXT are used.
target_pathnoPath of the target device. If not set, the production's default devices are used.
last_modified_limitnoTo identify growing files and to assure the file-writing has finished, this value indicates the minimum amount of seconds that must have passed since the last file change. Default is 30 seconds.
auto_detect_shotsnoBoolean value indicating whether medialoopster should perform an automatic shot detection during video asset initialization. If false, there will be no automatic shot detection. Default is true.
xml_transformationsnoOptional list of XMLTransformation names used for transforming XML.

browser.tasks.scan_folder_recursively

Similar to browser.tasks.scan_folder but also scans the contents of any subfolders.

Options

This tasks accepts the same options as browser.tasks.scan_folder task, excluding auto_detect_shots, and takes an additional optional argument.

NameRequiredDescription
in_placenoBoolean value indicating if files are moved to a destination folder. If true files will not be moved and thus keep their folder hierarchy. Default is false. Do not set both in_place and target_path arguments together.