namespace FileFlows.VideoNodes; /// /// Flow element to test if a video file has already been processed, this is done by looking for the FileFlows comment /// public class VideoAlreadyProcessed : VideoNode { /// /// Gets the number of inputs /// public override int Inputs => 1; /// /// Gets the number of outputs /// public override int Outputs => 2; /// /// Gets the type of flow element /// public override FlowElementType Type => FlowElementType.Logic; /// /// Gets the help URL /// public override string HelpUrl => "https://fileflows.com/docs/plugins/video-nodes/logical-nodes/video-already-processed"; /// public override string Icon => "fas fa-running"; /// /// Executes the flow element /// /// the arguments /// the output to call next public override int Execute(NodeParameters args) { var videoInfo = GetVideoInfo(args); if (videoInfo == null) { args.FailureReason = "Failed to retrieve video info"; args.Logger?.ELog(args.FailureReason); return -1; } bool alreadyProcessed = videoInfo.AlreadyProcessed; if (alreadyProcessed) { args.Logger?.ILog("Video has already been processed by FileFlows"); return 1; } args.Logger?.ILog("Video has not been processed by FileFlows"); return 2; } }