Mask Selected

Mask (encrypt) the selected videos

This sample masks all selected videos with IUtilities.Mask - the counterpart to the Unmask to Source sample.

using System;
using System.Collections.Generic;
using VideoCataloger;

class Script
{
    static public async System.Threading.Tasks.Task Run(IScripting scripting, string arguments)
    {
        IConsole console = scripting.GetConsole();
        console.Clear();

        List<long> selected = scripting.GetSelection().GetSelectedVideos();
        if (selected.Count == 0)
        {
            console.WriteLine("No videos selected.");
            return;
        }

        IUtilities utilities = scripting.GetUtilities();
        foreach (long video_id in selected)
        {
            console.WriteLine("Masking video " + video_id + ".");
            utilities.Mask(video_id);
        }

        scripting.GetGUI().Refresh("");
    }
}