diff --git a/BasicNodes/Functions/Tag.cs b/BasicNodes/Functions/Tag.cs new file mode 100644 index 00000000..93718d6a --- /dev/null +++ b/BasicNodes/Functions/Tag.cs @@ -0,0 +1,55 @@ +namespace FileFlows.BasicNodes.Functions; + +using FileFlows.Plugin; +using FileFlows.Plugin.Attributes; +using System.ComponentModel.DataAnnotations; + +/// +/// Flow element that Tags a file +/// +public class Tag : Node +{ + /// + public override int Inputs => 1; + /// + public override int Outputs => 1; + /// + public override FlowElementType Type => FlowElementType.Logic; + /// + public override string Icon => "fas fa-tag"; + /// + public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/tag"; + /// + public override bool FailureNode => true; + /// + public override LicenseLevel LicenseLevel => LicenseLevel.Basic; + + /// + /// Gets or sets the tags + /// + [TagSelection(1)] + public List Tags { get; set; } + + /// + /// Gets or sets if the tags should replace the existing tags + /// + [Boolean(2)] + public bool Replace { get; set; } + + /// + public override int Execute(NodeParameters args) + { + if (Tags == null || Tags.Count == 0) + { + args.FailureReason = "No tags selected"; + args.Logger?.ELog(args.FailureReason); + return -1; + } + + // if (Replace) + // args.File.Tags = Tags; + // else + // args.File.Tags.AddRange(Tags); + return 1; + } +} diff --git a/BasicNodes/i18n/de.json b/BasicNodes/i18n/de.json index 87361a19..38a1bce0 100644 --- a/BasicNodes/i18n/de.json +++ b/BasicNodes/i18n/de.json @@ -759,6 +759,15 @@ "Outputs": { "1": "Zip-Datei erstellt" } + }, + "Tag": { + "Description": "Markiert die Datei mit den angegebenen Tags", + "Label": "Tag", + "Fields": { + "Tags": "Tags", + "Replace": "Ersetzen", + "Replace-Help": "Ob die Tags ersetzt oder den vorhandenen Tags hinzugefügt werden sollen." + } } } }, diff --git a/BasicNodes/i18n/en.json b/BasicNodes/i18n/en.json index ddc476cb..a457c518 100644 --- a/BasicNodes/i18n/en.json +++ b/BasicNodes/i18n/en.json @@ -759,6 +759,15 @@ "Outputs": { "1": "Zip created" } + }, + "Tag": { + "Description": "Tags the file with the specified tags", + "Label": "Tag", + "Fields": { + "Tags": "Tags", + "Replace": "Replace", + "Replace-Help": "If the tags should be replaced or appended to the existing tags." + } } } }, diff --git a/BasicNodes/i18n/es.json b/BasicNodes/i18n/es.json index af17ac70..cf305d26 100644 --- a/BasicNodes/i18n/es.json +++ b/BasicNodes/i18n/es.json @@ -585,6 +585,15 @@ "1": "Archivo original reemplazado" } }, + "Tag": { + "Description": "Etiqueta el archivo con las etiquetas especificadas", + "Label": "Etiqueta", + "Fields": { + "Tags": "Etiquetas", + "Replace": "Reemplazar", + "Replace-Help": "Si las etiquetas deben reemplazarse o añadirse a las etiquetas existentes." + } + }, "Reprocess": { "Description": "El elemento de flujo te permite reprocesar el archivo original de la biblioteca con un nodo de procesamiento diferente.\n\n Si se selecciona el mismo nodo de procesamiento que el que actualmente procesa el archivo, el flujo fallará.", "Label": "Reprocesar", diff --git a/BasicNodes/i18n/fr.json b/BasicNodes/i18n/fr.json index 730f470c..81f75897 100644 --- a/BasicNodes/i18n/fr.json +++ b/BasicNodes/i18n/fr.json @@ -595,6 +595,15 @@ "Node-Help": "Le nœud de traitement pour traiter ce fichier." } }, + "Tag": { + "Description": "Tague le fichier avec les balises spécifiées", + "Label": "Tag", + "Fields": { + "Tags": "Balises", + "Replace": "Remplacer", + "Replace-Help": "Si les balises doivent être remplacées ou ajoutées aux balises existantes." + } + }, "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 b851aae2..3a13a47e 100644 --- a/BasicNodes/i18n/it.json +++ b/BasicNodes/i18n/it.json @@ -595,6 +595,15 @@ "Node-Help": "Il nodo di elaborazione per elaborare questo file." } }, + "Tag": { + "Description": "Etichetta il file con i tag specificati", + "Label": "Etichetta", + "Fields": { + "Tags": "Tag", + "Replace": "Sostituire", + "Replace-Help": "Se i tag devono essere sostituiti o aggiunti ai tag esistenti." + } + }, "SetVariable": { "Description": "Imposta una variabile nel flusso.", "Label": "Imposta Variabile", diff --git a/BasicNodes/i18n/ja.json b/BasicNodes/i18n/ja.json index f90a5534..81c4c83f 100644 --- a/BasicNodes/i18n/ja.json +++ b/BasicNodes/i18n/ja.json @@ -595,6 +595,15 @@ "Node-Help": "このファイルを処理するための処理ノード。" } }, + "Tag": { + "Description": "指定されたタグでファイルにタグを付けます", + "Label": "タグ", + "Fields": { + "Tags": "タグ", + "Replace": "置き換える", + "Replace-Help": "タグを置き換えるか、既存のタグに追加するか。" + } + }, "SetVariable": { "Description": "フロー内で変数を設定します。", "Label": "変数を設定", diff --git a/BasicNodes/i18n/ko.json b/BasicNodes/i18n/ko.json index 00ce6b2f..29570567 100644 --- a/BasicNodes/i18n/ko.json +++ b/BasicNodes/i18n/ko.json @@ -595,6 +595,15 @@ "Node-Help": "이 파일을 처리할 처리 노드입니다." } }, + "Tag": { + "Description": "지정된 태그로 파일에 태그를 지정합니다", + "Label": "태그", + "Fields": { + "Tags": "태그", + "Replace": "교체", + "Replace-Help": "태그를 교체하거나 기존 태그에 추가할지 여부." + } + }, "SetVariable": { "Description": "흐름에서 변수를 설정합니다.", "Label": "변수 설정", diff --git a/BasicNodes/i18n/nl.json b/BasicNodes/i18n/nl.json index 56da0c15..353bdf1c 100644 --- a/BasicNodes/i18n/nl.json +++ b/BasicNodes/i18n/nl.json @@ -595,6 +595,15 @@ "Node-Help": "De verwerkingsnode voor het verwerken van dit bestand." } }, + "Tag": { + "Description": "Tagt het bestand met de opgegeven tags", + "Label": "Tag", + "Fields": { + "Tags": "Tags", + "Replace": "Vervangen", + "Replace-Help": "Of de tags vervangen of toegevoegd moeten worden aan de bestaande tags." + } + }, "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 55de8170..51d92911 100644 --- a/BasicNodes/i18n/pt.json +++ b/BasicNodes/i18n/pt.json @@ -595,6 +595,15 @@ "Node-Help": "O nó de processamento para processar este arquivo." } }, + "Tag": { + "Description": "Marca o arquivo com as tags especificadas", + "Label": "Tag", + "Fields": { + "Tags": "Tags", + "Replace": "Substituir", + "Replace-Help": "Se as tags devem ser substituídas ou adicionadas às tags existentes." + } + }, "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 664403cc..c0403b06 100644 --- a/BasicNodes/i18n/ru.json +++ b/BasicNodes/i18n/ru.json @@ -595,6 +595,15 @@ "Node-Help": "Узел обработки для обработки этого файла." } }, + "Tag": { + "Description": "Присваивает файлу указанные теги", + "Label": "Тег", + "Fields": { + "Tags": "Теги", + "Replace": "Заменить", + "Replace-Help": "Следует ли заменить теги или добавить их к существующим тегам." + } + }, "SetVariable": { "Description": "Устанавливает переменную в потоке.", "Label": "Установить Переменную", diff --git a/BasicNodes/i18n/sv.json b/BasicNodes/i18n/sv.json index cab2fd9e..10dd349f 100644 --- a/BasicNodes/i18n/sv.json +++ b/BasicNodes/i18n/sv.json @@ -595,6 +595,15 @@ "Node-Help": "Behandlingsnod för att bearbeta denna fil." } }, + "Tag": { + "Description": "Taggar filen med de angivna taggarna", + "Label": "Tagg", + "Fields": { + "Tags": "Taggar", + "Replace": "Ersätt", + "Replace-Help": "Om taggarna ska ersättas eller läggas till de befintliga taggarna." + } + }, "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 8baad183..df1a7a68 100644 --- a/BasicNodes/i18n/zh.json +++ b/BasicNodes/i18n/zh.json @@ -595,6 +595,15 @@ "Node-Help": "用于处理该文件的处理节点。" } }, + "Tag": { + "Description": "使用指定的标签标记文件", + "Label": "标签", + "Fields": { + "Tags": "标签", + "Replace": "替换", + "Replace-Help": "标签是替换还是附加到现有标签。" + } + }, "SetVariable": { "Description": "在流中设置一个变量。", "Label": "设置变量", diff --git a/BasicNodes/i18n/zht.json b/BasicNodes/i18n/zht.json index a8f89262..25b090b3 100644 --- a/BasicNodes/i18n/zht.json +++ b/BasicNodes/i18n/zht.json @@ -595,6 +595,15 @@ "Node-Help": "處理此檔案的處理節點。" } }, + "Tag": { + "Description": "使用指定的標籤標記文件", + "Label": "標籤", + "Fields": { + "Tags": "標籤", + "Replace": "替換", + "Replace-Help": "標籤是替換還是附加到現有標籤。" + } + }, "SetVariable": { "Description": "在流程中設置變數。", "Label": "設置變數", diff --git a/FileFlows.Plugin.dll b/FileFlows.Plugin.dll index 20ec396f..d3ca5f07 100644 Binary files a/FileFlows.Plugin.dll and b/FileFlows.Plugin.dll differ diff --git a/FileFlows.Plugin.pdb b/FileFlows.Plugin.pdb index 3ce7e0be..a59b4325 100644 Binary files a/FileFlows.Plugin.pdb and b/FileFlows.Plugin.pdb differ