How to find videos that has a cast

In Fast video cataloger, you can assign actors to a video cast. Actors can have names, portraits, and more. Actors could be used as actual actors, but you can also use them for clients or other entities related to a video and where you want to add some more metadata than just a simple tag.

You can search for actors from the search window, but what if you want to search for videos that do not have an actor assigned or videos that do have an actor?

You can not do that kind of search from the search window, but it is possible from the scripting API. Remember that you can also bind buttons or shortcuts keys to scripts if these kind of searches are important for your workflow.

Here is an example script that will select all videos that have an assigned cast from the current search result. Simply copy and paste this into the script window of Fast video cataloger.

select cast

script to select video cast

using System.Collections.Generic;
using System.Runtime;
using VideoCataloger;
using VideoCataloger.RemoteCatalogService;


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

    var catalog = scripting.GetVideoCatalogService();
    VideoQuery video_query=new VideoQuery();
    VideoFileEntry[] all_videos = catalog.SearchVideos( video_query );

    long[] VideoToSearch =new long[1];

    foreach ( VideoFileEntry entry in all_videos )
    {
      VideoToSearch[0] =entry.ID;
      Actor[] video_actors = catalog.GetCast(VideoToSearch);
      bool has_cast =true;
      if (video_actors.Length == 0 )
        has_cast =false;
      if (has_cast)  // use !has_cast to select video without a cast 
        selected.Add( entry.ID);
    }
       
    ISelection selection = scripting.GetSelection();
    selection.SetSelectedVideos(selected);
  }
}