diff --git a/BasicNodes/Functions/SetFileFlowsThumbnail.cs b/BasicNodes/Functions/SetFileFlowsThumbnail.cs new file mode 100644 index 00000000..4176bf37 --- /dev/null +++ b/BasicNodes/Functions/SetFileFlowsThumbnail.cs @@ -0,0 +1,43 @@ +using FileFlows.Plugin; +using FileFlows.Plugin.Attributes; + +namespace FileFlows.BasicNodes.Functions; + + +/// +/// Flow element that sets the thumbnail of a file in FileFlows +/// +public class SetFileFlowsThumbnail: Node +{ + /// + public override int Inputs => 1; + /// + public override int Outputs => 1; + /// + public override string Icon => "fas fa-image"; + /// + public override FlowElementType Type => FlowElementType.Process; + /// + public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/set-fileflows-thumbnail"; + + /// + /// Gets or sets the name of the file of the thumbnail + /// + [TextVariable(1)] + public string FilePath { get; set; } + + /// + public override int Execute(NodeParameters args) + { + string file = args.ReplaceVariables(FilePath ?? string.Empty, true)?.EmptyAsNull() ?? args.WorkingFile; + if(string.IsNullOrWhiteSpace(file)) + return args.Fail("File Path not set"); + var localResult = args.FileService.GetLocalPath(file); + if(localResult.Failed(out var error)) + return args.Fail("Failed to get local path: " + error); + var local = localResult.Value; + args.SetThumbnail(file); + args.Logger.ILog("Thumbnail set"); + return 1; + } +} \ No newline at end of file diff --git a/BasicNodes/i18n/de.json b/BasicNodes/i18n/de.json index 94150f33..fa2871d2 100644 --- a/BasicNodes/i18n/de.json +++ b/BasicNodes/i18n/de.json @@ -630,6 +630,17 @@ "Node-Help": "Der Verarbeitungsnode, um diese Datei zu verarbeiten." } }, + "SetFileFlowsThumbnail": { + "Description": "Legt ein Miniaturbild für diese Datei in FileFlows fest.", + "Label": "FileFlows-Miniaturbild festlegen", + "Fields": { + "FilePath": "Dateipfad", + "FilePath-Help": "Der vollständige Pfad zur Bilddatei, die als Miniaturbild verwendet werden soll." + }, + "Outputs": { + "1": "Miniaturbild gesetzt" + } + }, "SetVariable": { "Description": "Setzt eine Variable im Flow.", "Label": "Variable setzen", diff --git a/BasicNodes/i18n/en.json b/BasicNodes/i18n/en.json index 266112e5..f9cafaec 100644 --- a/BasicNodes/i18n/en.json +++ b/BasicNodes/i18n/en.json @@ -630,6 +630,17 @@ "Node-Help": "The processing node to process this file." } }, + "SetFileFlowsThumbnail": { + "Description": "Sets the thumbnail for this file in FileFlows.", + "Label": "Set FileFlows Thumbnail", + "Fields": { + "FilePath": "File Path", + "FilePath-Help": "The full path to the image file to use as the thumbnail." + }, + "Outputs": { + "1": "Thumbnail set" + } + }, "SetVariable": { "Description": "Sets a variable in the flow.", "Label": "Set Variable", diff --git a/BasicNodes/i18n/es.json b/BasicNodes/i18n/es.json index b3bd19ef..973ca882 100644 --- a/BasicNodes/i18n/es.json +++ b/BasicNodes/i18n/es.json @@ -630,6 +630,17 @@ "Node-Help": "El nodo de procesamiento para procesar este archivo." } }, + "SetFileFlowsThumbnail": { + "Description": "Establece una miniatura para este archivo en FileFlows.", + "Label": "Establecer miniatura de FileFlows", + "Fields": { + "FilePath": "Ruta del archivo", + "FilePath-Help": "La ruta completa del archivo de imagen que se utilizará como miniatura." + }, + "Outputs": { + "1": "Miniatura establecida" + } + }, "SetVariable": { "Description": "Establece una variable en el flujo.", "Label": "Establecer Variable", diff --git a/BasicNodes/i18n/fr.json b/BasicNodes/i18n/fr.json index e8b72986..94904816 100644 --- a/BasicNodes/i18n/fr.json +++ b/BasicNodes/i18n/fr.json @@ -630,6 +630,17 @@ "Node-Help": "Le nœud de traitement pour traiter ce fichier." } }, + "SetFileFlowsThumbnail": { + "Description": "Définit une miniature pour ce fichier dans FileFlows.", + "Label": "Définir la miniature de FileFlows", + "Fields": { + "FilePath": "Chemin du fichier", + "FilePath-Help": "Le chemin complet du fichier image à utiliser comme miniature." + }, + "Outputs": { + "1": "Miniature définie" + } + }, "SetVariable": { "Description": "Définit une variable dans le flux.", "Label": "Définir une Variable", diff --git a/BasicNodes/i18n/it.json b/BasicNodes/i18n/it.json index 0a742402..31ed076b 100644 --- a/BasicNodes/i18n/it.json +++ b/BasicNodes/i18n/it.json @@ -630,6 +630,17 @@ "Node-Help": "Il nodo di elaborazione per elaborare questo file." } }, + "SetFileFlowsThumbnail": { + "Description": "Imposta una miniatura per questo file in FileFlows.", + "Label": "Imposta miniatura di FileFlows", + "Fields": { + "FilePath": "Percorso del file", + "FilePath-Help": "Il percorso completo del file immagine da usare come miniatura." + }, + "Outputs": { + "1": "Miniatura impostata" + } + }, "SetVariable": { "Description": "Imposta una variabile nel flusso.", "Label": "Imposta Variabile", diff --git a/BasicNodes/i18n/ja.json b/BasicNodes/i18n/ja.json index 0261cf47..8700f4f4 100644 --- a/BasicNodes/i18n/ja.json +++ b/BasicNodes/i18n/ja.json @@ -630,6 +630,17 @@ "Node-Help": "このファイルを処理するための処理ノード。" } }, + "SetFileFlowsThumbnail": { + "Description": "FileFlowsでこのファイルのサムネイルを設定します。", + "Label": "FileFlowsのサムネイルを設定", + "Fields": { + "FilePath": "ファイルパス", + "FilePath-Help": "サムネイルとして使用する画像ファイルのフルパス。" + }, + "Outputs": { + "1": "サムネイルが設定されました" + } + }, "SetVariable": { "Description": "フロー内で変数を設定します。", "Label": "変数を設定", diff --git a/BasicNodes/i18n/ko.json b/BasicNodes/i18n/ko.json index 7419344f..d037fc79 100644 --- a/BasicNodes/i18n/ko.json +++ b/BasicNodes/i18n/ko.json @@ -630,6 +630,17 @@ "Node-Help": "이 파일을 처리할 처리 노드입니다." } }, + "SetFileFlowsThumbnail": { + "Description": "FileFlows에서 이 파일의 썸네일을 설정합니다.", + "Label": "FileFlows 썸네일 설정", + "Fields": { + "FilePath": "파일 경로", + "FilePath-Help": "썸네일로 사용할 이미지 파일의 전체 경로입니다." + }, + "Outputs": { + "1": "썸네일 설정됨" + } + }, "SetVariable": { "Description": "흐름에서 변수를 설정합니다.", "Label": "변수 설정", diff --git a/BasicNodes/i18n/nl.json b/BasicNodes/i18n/nl.json index 8b1859d2..7d0584ca 100644 --- a/BasicNodes/i18n/nl.json +++ b/BasicNodes/i18n/nl.json @@ -630,6 +630,17 @@ "Node-Help": "De verwerkingsnode voor het verwerken van dit bestand." } }, + "SetFileFlowsThumbnail": { + "Description": "Stelt een miniatuur in voor dit bestand in FileFlows.", + "Label": "FileFlows Miniatuur instellen", + "Fields": { + "FilePath": "Bestandspad", + "FilePath-Help": "Het volledige pad naar het afbeeldingsbestand dat als miniatuur moet worden gebruikt." + }, + "Outputs": { + "1": "Miniatuur ingesteld" + } + }, "SetVariable": { "Description": "Stelt een variabele in binnen de stroom.", "Label": "Stel Variabele In", diff --git a/BasicNodes/i18n/pt.json b/BasicNodes/i18n/pt.json index 2f1d861e..8ab97cef 100644 --- a/BasicNodes/i18n/pt.json +++ b/BasicNodes/i18n/pt.json @@ -630,6 +630,17 @@ "Node-Help": "O nó de processamento para processar este arquivo." } }, + "SetFileFlowsThumbnail": { + "Description": "Define uma miniatura para este arquivo no FileFlows.", + "Label": "Definir miniatura do FileFlows", + "Fields": { + "FilePath": "Caminho do arquivo", + "FilePath-Help": "O caminho completo do arquivo de imagem a ser usado como miniatura." + }, + "Outputs": { + "1": "Miniatura definida" + } + }, "SetVariable": { "Description": "Define uma variável no fluxo.", "Label": "Definir uma Variável", diff --git a/BasicNodes/i18n/ru.json b/BasicNodes/i18n/ru.json index 9b7ab98e..cac3de96 100644 --- a/BasicNodes/i18n/ru.json +++ b/BasicNodes/i18n/ru.json @@ -630,6 +630,17 @@ "Node-Help": "Узел обработки для обработки этого файла." } }, + "SetFileFlowsThumbnail": { + "Description": "Устанавливает миниатюру для этого файла в FileFlows.", + "Label": "Установить миниатюру FileFlows", + "Fields": { + "FilePath": "Путь к файлу", + "FilePath-Help": "Полный путь к файлу изображения, который будет использоваться в качестве миниатюры." + }, + "Outputs": { + "1": "Миниатюра установлена" + } + }, "SetVariable": { "Description": "Устанавливает переменную в потоке.", "Label": "Установить Переменную", diff --git a/BasicNodes/i18n/sv.json b/BasicNodes/i18n/sv.json index dd3cf9b0..87758366 100644 --- a/BasicNodes/i18n/sv.json +++ b/BasicNodes/i18n/sv.json @@ -630,6 +630,17 @@ "Node-Help": "Behandlingsnod för att bearbeta denna fil." } }, + "SetFileFlowsThumbnail": { + "Description": "Ställer in en miniatyr för denna fil i FileFlows.", + "Label": "Ställ in FileFlows-miniatyr", + "Fields": { + "FilePath": "Filväg", + "FilePath-Help": "Den fullständiga sökvägen till bildfilen som ska användas som miniatyr." + }, + "Outputs": { + "1": "Miniatyr inställd" + } + }, "SetVariable": { "Description": "Sätter en variabel i flödet.", "Label": "Ställ In Variabel", diff --git a/BasicNodes/i18n/zh.json b/BasicNodes/i18n/zh.json index 265e742a..989eccb4 100644 --- a/BasicNodes/i18n/zh.json +++ b/BasicNodes/i18n/zh.json @@ -630,6 +630,17 @@ "Node-Help": "用于处理该文件的处理节点。" } }, + "SetFileFlowsThumbnail": { + "Description": "在 FileFlows 中为此文件设置缩略图。", + "Label": "设置 FileFlows 缩略图", + "Fields": { + "FilePath": "文件路径", + "FilePath-Help": "要用作缩略图的图片文件的完整路径。" + }, + "Outputs": { + "1": "缩略图已设置" + } + }, "SetVariable": { "Description": "在流中设置一个变量。", "Label": "设置变量", diff --git a/BasicNodes/i18n/zht.json b/BasicNodes/i18n/zht.json index be259f64..eea85bdd 100644 --- a/BasicNodes/i18n/zht.json +++ b/BasicNodes/i18n/zht.json @@ -630,6 +630,17 @@ "Node-Help": "處理此檔案的處理節點。" } }, + "SetFileFlowsThumbnail": { + "Description": "在 FileFlows 中為此文件設置縮略圖。", + "Label": "設置 FileFlows 縮略圖", + "Fields": { + "FilePath": "文件路徑", + "FilePath-Help": "要用作縮略圖的圖片文件的完整路徑。" + }, + "Outputs": { + "1": "縮略圖已設置" + } + }, "SetVariable": { "Description": "在流程中設置變數。", "Label": "設置變數", diff --git a/FileFlows.Common.dll b/FileFlows.Common.dll index dcb2a675..5b1a4687 100644 Binary files a/FileFlows.Common.dll and b/FileFlows.Common.dll differ diff --git a/FileFlows.Common.pdb b/FileFlows.Common.pdb index e657b1c3..e6b863d1 100644 Binary files a/FileFlows.Common.pdb and b/FileFlows.Common.pdb differ diff --git a/FileFlows.Plugin.dll b/FileFlows.Plugin.dll index b3eca306..d4580aa6 100644 Binary files a/FileFlows.Plugin.dll and b/FileFlows.Plugin.dll differ diff --git a/FileFlows.Plugin.pdb b/FileFlows.Plugin.pdb index ff390819..bb098b76 100644 Binary files a/FileFlows.Plugin.pdb and b/FileFlows.Plugin.pdb differ