Copy Tasks

Learn how to add, run, stop and delete transcodes.

Get One Task

const uuid = "<task_uuid>";
const task = library.query.tasks.one(uuid).fetch();

Get Many Tasks

const tasks = library.query.tasks.many().fetch(); //currently no filters are supported

Run Task

const uuid = "<task_uuid>";

const callback = (progress) =>{
    console.log(progress);
}

const cancelToken = { cancel : false }

await library.query.tasks.one(uuid).run(callback, cancelToken);

Stop a Task

To stop a transcode you need to set the cancel flag to true. The process will exit at the next possible opportunity.

cancelToken.cancel = true;

Delete One Task

const uuid = "<transcode_uuid>";

library.query.tasks.one(uuid).delete();

Add One Task

library.query.tasks.post({
    label: string; 
    jobs: { 
        source: string; 
        destinations?: string[] | null 
    }[]
})

Generate One Task

library.query.tasks.generate({
  label: string;
  source: string;
  matchExpression?: string;
  types?: string[];
  destinations: string[];
  settings?: {
    preserveFolderStructure?: boolean;
    createSubFolder?: boolean;
    ignoreDuplicates?: boolean;
  };
}) 

Last updated