diff --git a/FileFlowsPlugins.sln b/FileFlowsPlugins.sln index 633b2689..60672e05 100644 --- a/FileFlowsPlugins.sln +++ b/FileFlowsPlugins.sln @@ -43,6 +43,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginTestLibrary", "Plugin EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Docker", "Docker\Docker.csproj", "{2E26B8A7-269B-4E0C-A4D6-936B6FEC01F5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Reseller", "Reseller\Reseller.csproj", "{AB24139B-9B44-47EA-829A-954CFFC23A65}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -129,6 +131,10 @@ Global {2E26B8A7-269B-4E0C-A4D6-936B6FEC01F5}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E26B8A7-269B-4E0C-A4D6-936B6FEC01F5}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E26B8A7-269B-4E0C-A4D6-936B6FEC01F5}.Release|Any CPU.Build.0 = Release|Any CPU + {AB24139B-9B44-47EA-829A-954CFFC23A65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AB24139B-9B44-47EA-829A-954CFFC23A65}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AB24139B-9B44-47EA-829A-954CFFC23A65}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AB24139B-9B44-47EA-829A-954CFFC23A65}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/FileFlowsPlugins.sln.DotSettings.user b/FileFlowsPlugins.sln.DotSettings.user index aec01964..51d45496 100644 --- a/FileFlowsPlugins.sln.DotSettings.user +++ b/FileFlowsPlugins.sln.DotSettings.user @@ -1,6 +1,8 @@  ForceIncluded + ForceIncluded ForceIncluded + ForceIncluded <SessionState ContinuousTestingMode="0" IsActive="True" Name="BurnIn" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> <Or> <TestAncestor> diff --git a/Plex/MediaManagement/_PlexNode.cs b/Plex/MediaManagement/_PlexNode.cs index 15aee83d..7dfbb0f1 100644 --- a/Plex/MediaManagement/_PlexNode.cs +++ b/Plex/MediaManagement/_PlexNode.cs @@ -50,7 +50,7 @@ public abstract class PlexNode:Node args.Logger?.ILog("Working File (Unmapped): " + path); if (args.IsDirectory == false) { - // juse use / + // just use / path = path.Replace("\\", "/"); path = path[..path.LastIndexOf("/", StringComparison.Ordinal)]; } diff --git a/Reseller/FlowElements/MoveToUserFolder.cs b/Reseller/FlowElements/MoveToUserFolder.cs new file mode 100644 index 00000000..3c9f73b4 --- /dev/null +++ b/Reseller/FlowElements/MoveToUserFolder.cs @@ -0,0 +1,49 @@ +using FileFlows.Plugin.Helpers; + +namespace FileFlows.ResellerPlugin.FlowElements; + +/// +/// Moves a file to a new location +/// +public class MoveToUserFolder: Node +{ + /// + /// Gets the number of inputs + /// + public override int Inputs => 1; + /// + /// Gets the type of flow element + /// + public override FlowElementType Type => FlowElementType.Process; + /// + /// Gets the icon for the flow element + /// + public override string Icon => "fas fa-file-export"; + /// + /// Gets the help URL + /// + public override string HelpUrl => "https://fileflows.com/docs/plugins/reseller/move-to-user-folder"; + + /// + public override int Execute(NodeParameters args) + { + if (args.Variables.TryGetValue("ResellerUserOutputDir", out var oOutputDir) == false || string.IsNullOrWhiteSpace(oOutputDir as string)) + return args.Fail("No user output directory in variables"); + + var outputDir = (string)oOutputDir; + + string filename = FileHelper.GetShortFileName(args.WorkingFile); + var noExtension = FileHelper.GetShortFileNameWithoutExtension(args.WorkingFile); + if(Guid.TryParse(noExtension, out _)) + filename = FileHelper.GetShortFileNameWithoutExtension(args.LibraryFileName) + FileHelper.GetExtension(args.WorkingFile); + + string fullPath = Path.Combine(outputDir, filename); + args.Logger?.ILog("Full Output Path: " + fullPath); + + var result = args.MoveFile(fullPath); + if (result.Failed(out var error)) + return args.Fail(error); + + return 1; + } +} \ No newline at end of file diff --git a/Reseller/GlobalUsings.cs b/Reseller/GlobalUsings.cs new file mode 100644 index 00000000..63e0c527 --- /dev/null +++ b/Reseller/GlobalUsings.cs @@ -0,0 +1,6 @@ +global using System; +global using System.Text; +global using System.ComponentModel.DataAnnotations; +global using FileFlows.Plugin; +global using FileFlows.Plugin.Attributes; +global using FileFlows.Common; \ No newline at end of file diff --git a/Reseller/Plugin.cs b/Reseller/Plugin.cs new file mode 100644 index 00000000..e9ba207b --- /dev/null +++ b/Reseller/Plugin.cs @@ -0,0 +1,21 @@ +namespace FileFlows.ResellerPlugin; + +/// +/// Plugin Information +/// +public class Plugin : FileFlows.Plugin.IPlugin +{ + /// + public Guid Uid => new Guid("ba8cfaa3-4ac0-4a39-9e1b-a48def94eb3d"); + /// + public string Name => "Reseller"; + /// + public string MinimumVersion => "24.12.4.4168"; + /// + public string Icon => "fas fa-people-carry"; + + /// + public void Init() + { + } +} diff --git a/Reseller/Reseller.csproj b/Reseller/Reseller.csproj new file mode 100644 index 00000000..27b0cc59 --- /dev/null +++ b/Reseller/Reseller.csproj @@ -0,0 +1,79 @@ + + + + net8.0 + enable + enable + FileFlows.ResellerPlugin + 1.1.1.528 + 1.1.1.528 + true + FileFlows + John Andrews + Reseller + https://fileflows.com/ + Plugin that provides Reseller related flow elements + True + Reseller + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + + + + + + + ..\FileFlows.Plugin.dll + + + ..\FileFlows.Common.dll + False + + + + diff --git a/Reseller/i18n/de.json b/Reseller/i18n/de.json new file mode 100644 index 00000000..02ad9a74 --- /dev/null +++ b/Reseller/i18n/de.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "Verschiebt die Arbeitsdatei in das Ausgabeverzeichnis des Benutzers.", + "Label": "In Benutzerordner verschieben", + "Outputs": { + "1": "Datei wurde erfolgreich verschoben" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "Plugin, das flow-bezogene Elemente für Reseller bereitstellt", + "Label": "Reseller" + } + } +} diff --git a/Reseller/i18n/en.json b/Reseller/i18n/en.json new file mode 100644 index 00000000..29f57ac0 --- /dev/null +++ b/Reseller/i18n/en.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "Moves the working file into the users output directory.", + "Label": "Move To User Folder", + "Outputs": { + "1": "File was was successfully moved" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "Plugin that provides Reseller related flow elements", + "Label": "Reseller" + } + } +} \ No newline at end of file diff --git a/Reseller/i18n/es.json b/Reseller/i18n/es.json new file mode 100644 index 00000000..8aa2cd6c --- /dev/null +++ b/Reseller/i18n/es.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "Mueve el archivo de trabajo al directorio de salida del usuario.", + "Label": "Mover a la Carpeta del Usuario", + "Outputs": { + "1": "El archivo se movió con éxito" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "Complemento que proporciona elementos de flujo relacionados con el revendedor", + "Label": "Revendedor" + } + } +} diff --git a/Reseller/i18n/fr.json b/Reseller/i18n/fr.json new file mode 100644 index 00000000..bb8bf249 --- /dev/null +++ b/Reseller/i18n/fr.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "Déplace le fichier de travail dans le répertoire de sortie de l'utilisateur.", + "Label": "Déplacer vers le Dossier Utilisateur", + "Outputs": { + "1": "Le fichier a été déplacé avec succès" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "Plugin qui fournit des éléments de flux liés aux revendeurs", + "Label": "Revendeur" + } + } +} diff --git a/Reseller/i18n/it.json b/Reseller/i18n/it.json new file mode 100644 index 00000000..bc788642 --- /dev/null +++ b/Reseller/i18n/it.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "Sposta il file di lavoro nella directory di output dell'utente.", + "Label": "Sposta nella Cartella dell'Utente", + "Outputs": { + "1": "Il file è stato spostato con successo" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "Plugin che fornisce elementi di flusso relativi ai rivenditori", + "Label": "Rivenditore" + } + } +} diff --git a/Reseller/i18n/ja.json b/Reseller/i18n/ja.json new file mode 100644 index 00000000..1043ec9b --- /dev/null +++ b/Reseller/i18n/ja.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "作業ファイルをユーザーの出力ディレクトリに移動します。", + "Label": "ユーザーフォルダーに移動", + "Outputs": { + "1": "ファイルは正常に移動されました" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "リセラー関連のフロー要素を提供するプラグイン", + "Label": "リセラー" + } + } +} diff --git a/Reseller/i18n/ko.json b/Reseller/i18n/ko.json new file mode 100644 index 00000000..67adb2eb --- /dev/null +++ b/Reseller/i18n/ko.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "작업 파일을 사용자의 출력 디렉토리로 이동합니다.", + "Label": "사용자 폴더로 이동", + "Outputs": { + "1": "파일이 성공적으로 이동되었습니다" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "리셀러 관련 흐름 요소를 제공하는 플러그인", + "Label": "리셀러" + } + } +} diff --git a/Reseller/i18n/nl.json b/Reseller/i18n/nl.json new file mode 100644 index 00000000..faa0cdae --- /dev/null +++ b/Reseller/i18n/nl.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "Verplaatst het werkbestand naar de uitvoermap van de gebruiker.", + "Label": "Verplaats naar Gebruikersmap", + "Outputs": { + "1": "Bestand is succesvol verplaatst" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "Plugin die reseller-gerelateerde flow-elementen biedt", + "Label": "Reseller" + } + } +} diff --git a/Reseller/i18n/pt.json b/Reseller/i18n/pt.json new file mode 100644 index 00000000..ffa8bc3b --- /dev/null +++ b/Reseller/i18n/pt.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "Move o arquivo de trabalho para o diretório de saída do usuário.", + "Label": "Mover para a Pasta do Usuário", + "Outputs": { + "1": "O arquivo foi movido com sucesso" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "Plugin que fornece elementos de fluxo relacionados ao revendedor", + "Label": "Revendedor" + } + } +} diff --git a/Reseller/i18n/ru.json b/Reseller/i18n/ru.json new file mode 100644 index 00000000..d46cb008 --- /dev/null +++ b/Reseller/i18n/ru.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "Перемещает рабочий файл в выходной каталог пользователя.", + "Label": "Переместить в Папку Пользователя", + "Outputs": { + "1": "Файл успешно перемещен" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "Плагин, предоставляющий элементы потока, связанные с реселлерами", + "Label": "Реселлер" + } + } +} diff --git a/Reseller/i18n/sv.json b/Reseller/i18n/sv.json new file mode 100644 index 00000000..b246f7d7 --- /dev/null +++ b/Reseller/i18n/sv.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "Flyttar arbetsfilen till användarens utmatningskatalog.", + "Label": "Flytta till Användarmapp", + "Outputs": { + "1": "Filen flyttades framgångsrikt" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "Plugin som tillhandahåller flödesrelaterade element för återförsäljare", + "Label": "Återförsäljare" + } + } +} diff --git a/Reseller/i18n/zh.json b/Reseller/i18n/zh.json new file mode 100644 index 00000000..f2371daa --- /dev/null +++ b/Reseller/i18n/zh.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "将工作文件移动到用户的输出目录。", + "Label": "移动到用户文件夹", + "Outputs": { + "1": "文件已成功移动" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "提供与经销商相关的流程元素的插件", + "Label": "经销商" + } + } +} diff --git a/Reseller/i18n/zht.json b/Reseller/i18n/zht.json new file mode 100644 index 00000000..61266499 --- /dev/null +++ b/Reseller/i18n/zht.json @@ -0,0 +1,19 @@ +{ + "Flow": { + "Parts": { + "MoveToUserFolder": { + "Description": "將工作檔案移動到使用者的輸出目錄。", + "Label": "移動到使用者資料夾", + "Outputs": { + "1": "檔案已成功移動" + } + } + } + }, + "Plugins": { + "Web": { + "Description": "提供與經銷商相關的流程元素的外掛程式", + "Label": "經銷商" + } + } +} diff --git a/Web/Plugin.cs b/Web/Plugin.cs index df69dcd1..c188a481 100644 --- a/Web/Plugin.cs +++ b/Web/Plugin.cs @@ -1,5 +1,8 @@ namespace FileFlows.Web; +/// +/// Plugin Information +/// public class Plugin : FileFlows.Plugin.IPlugin { ///