This commit is contained in:
John Andrews
2025-02-16 13:20:43 +13:00
parent f226872cc5
commit 72f644ef3d
2 changed files with 44 additions and 44 deletions

View File

@@ -1,43 +1,43 @@
namespace FileFlows.FileDropPlugin.FlowElements;
/// <summary>
/// Sets the display name ot a file drop friendly name
/// </summary>
public class SetFileDropDisplayName : Node
{
/// <inheritdoc />
public override int Inputs => 1;
/// <inheritdoc />
public override int Outputs => 1;
/// <inheritdoc />
public override string HelpUrl => "https://fileflows.com/docs/plugins/file-drop/set-file-drop-display-name";
/// <inheritdoc />
public override string Group => "File Drop";
/// <inheritdoc />
public override FlowElementType Type => FlowElementType.Process;
/// <inheritdoc />
public override string Icon => "fas fa-file-signature";
/// <inheritdoc />
public override int Execute(NodeParameters args)
{
var username = Variables["FileDropUser"]?.ToString() ??
Variables["FileDropUserUid"]?.ToString();
if (string.IsNullOrWhiteSpace(username))
{
args.Logger?.WLog("Failed to get file drop username");
return 1;
}
var shortname = Variables["ShortName"]?.ToString();
if (string.IsNullOrWhiteSpace(shortname))
{
args.Logger?.WLog("Failed to get shortname");
return 1;
}
args.SetDisplayName($"{username}: {shortname}");
return base.Execute(args);
}
}
// namespace FileFlows.FileDropPlugin.FlowElements;
//
// /// <summary>
// /// Sets the display name ot a file drop friendly name
// /// </summary>
// public class SetFileDropDisplayName : Node
// {
// /// <inheritdoc />
// public override int Inputs => 1;
// /// <inheritdoc />
// public override int Outputs => 1;
// /// <inheritdoc />
// public override string HelpUrl => "https://fileflows.com/docs/plugins/file-drop/set-file-drop-display-name";
// /// <inheritdoc />
// public override string Group => "File Drop";
// /// <inheritdoc />
// public override FlowElementType Type => FlowElementType.Process;
// /// <inheritdoc />
// public override string Icon => "fas fa-file-signature";
//
// /// <inheritdoc />
// public override int Execute(NodeParameters args)
// {
// var username = Variables["FileDropUser"]?.ToString() ??
// Variables["FileDropUserUid"]?.ToString();
// if (string.IsNullOrWhiteSpace(username))
// {
// args.Logger?.WLog("Failed to get file drop username");
// return 1;
// }
//
// var shortname = Variables["ShortName"]?.ToString();
// if (string.IsNullOrWhiteSpace(shortname))
// {
// args.Logger?.WLog("Failed to get shortname");
// return 1;
// }
//
// args.SetDisplayName($"{username}: {shortname}");
//
// return base.Execute(args);
// }
// }

View File

@@ -12,7 +12,7 @@ public class Plugin : FileFlows.Plugin.IPlugin
/// <inheritdoc />
public string MinimumVersion => "24.12.4.4168";
/// <inheritdoc />
public string Icon => "fas fa-people-carry";
public string Icon => "fas fa-tint";
/// <inheritdoc />
public void Init()