git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Tue, 7 Aug 2018 22:51:50 +0000 (22:51 +0000)
committerVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Tue, 7 Aug 2018 22:51:50 +0000 (22:51 +0000)
client/Maestro/Configuration/-configuration-nexio-ingest.json [moved from client/Maestro/Configuration/configuration-nexio-ingest.json with 100% similarity]
client/Maestro/Configuration/configuration-studio.json [moved from client/Maestro/Configuration/-configuration-studio.json with 94% similarity]
client/Maestro/Maestro.csproj
client/MaestroShared/Targets/FTPTargetProcessor.cs
client/MaestroShared/Targets/FXPTargetProcessor.cs

similarity index 94%
rename from client/Maestro/Configuration/-configuration-studio.json
rename to client/Maestro/Configuration/configuration-studio.json
index 3c3581448495dde279fd6107039d341edf4b2d53..74e6e22766e3b8442d7beb1e411ed152b01271af 100644 (file)
@@ -67,7 +67,7 @@
       "tag": "Archiválás",\r
       "saveArchiveMetadata": true,\r
       "remote": {\r
-        "address": "ftp://10.10.1.100:21/ARCHIVE",\r
+        "address": "ftp://10.10.1.100:21/ARCHIVE/ONE",\r
         "userName": "mediacube",\r
         "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
         "timeout": 1000\r
index 8a3fe707be9d5912f2deee3e8fc4cef9109c8728..67b86884aa35883fb7abcaeb3162dbdef81c3936 100644 (file)
     <None Include="Configuration\global.json">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
     </None>\r
-    <None Include="Configuration\configuration-nexio-ingest.json">\r
+    <None Include="Configuration\-configuration-nexio-ingest.json">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
     </None>\r
     <None Include="Configuration\-configuration-editor.json">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
     </None>\r
-    <None Include="Configuration\-configuration-nle.json">\r
+    <None Include="Configuration\configuration-nle.json">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
     </None>\r
     <None Include="Configuration\-configuration-playout-ingest.json">\r
     <None Include="Configuration\-configuration-tqc-check.json">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
     </None>\r
-    <None Include="Configuration\UJ-configuration-tqc-check.json">\r
+    <None Include="Configuration\-UJ-configuration-tqc-check.json">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
     </None>\r
     <None Include="Connected Services\packages.config" />\r
     <None Include="Configuration\-configuration-sxs.json">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
     </None>\r
-    <None Include="Configuration\-configuration-studio.json">\r
+    <None Include="Configuration\configuration-studio.json">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
     </None>\r
   </ItemGroup>\r
index 4cf88f19ab3fc331ea303b48bc919f0b1c29d27b..c0d6b3e66a5b16ab9e3604aa6c7ee44ed5a2bcc5 100644 (file)
@@ -69,7 +69,7 @@ namespace MaestroShared.Targets {
                 long sourceSize = inputFile.Length;\r
                 long uploadedSize = targetFTP.GetFileSize(OutputName);\r
                 if (sourceSize != uploadedSize)\r
-                    throw new Exception(UPLOAD_ERROR);\r
+                    throw new Exception(COPY_SIZE_ERROR);\r
             }\r
         }\r
 \r
index 6e235a0e43e3c3771c7ad648bddcbb47f88bf46e..2514ab0768e623e3393ccfed584baa420fcf3d1e 100644 (file)
@@ -3,7 +3,6 @@ using MaestroShared.Configuration;
 using MaestroShared.Target;\r
 using NLog;\r
 using System;\r
-using System.Diagnostics;\r
 using System.IO;\r
 using System.Text.RegularExpressions;\r
 using System.Threading;\r
@@ -16,6 +15,10 @@ namespace MaestroShared.Targets {
         private const string SPACE = " ";\r
         private Logger logger = LogManager.GetCurrentClassLogger();\r
         private Source sourceConfig;\r
+        private FtpClient sourceFTP = null;\r
+        private FtpClient monitorFTP = null;\r
+        private long sourceFileLength = 0;\r
+        private long uploadedFileLength = 0;\r
         Uri inputUri;\r
 \r
         public override void Initialize(Control parent, TargetProcessorParameter parameters) {\r
@@ -42,16 +45,17 @@ namespace MaestroShared.Targets {
         }\r
 \r
         protected override void UploadFile() {\r
-            FtpClient sourceFTP = null;\r
-            FtpClient monitorFTP = null;\r
-\r
             try {\r
                 sourceFTP = CreateClient(sourceConfig.Remote);\r
 \r
+                logger.Info("1 " + IsNexioServer(sourceFTP));\r
+\r
                 string input = Uri.UnescapeDataString(inputUri.AbsolutePath);\r
-                long ilength = sourceFTP.GetFileSize(input);\r
+                sourceFileLength = sourceFTP.GetFileSize(input);\r
                 if (Parameters.TargetConfig.NexioServer)\r
-                    ilength = ilength / 2;\r
+                    sourceFileLength = sourceFileLength / 2;\r
+\r
+                logger.Info("2 " + IsNexioServer(sourceFTP));\r
 \r
                 FtpReply replyPASV = targetFTP.Execute("PASV");\r
                 if (!replyPASV.Success)\r
@@ -65,11 +69,15 @@ namespace MaestroShared.Targets {
                 if (!replyPORT.Success)\r
                     throw new Exception(replyPORT.ErrorMessage);\r
 \r
+                logger.Info("3 " + IsNexioServer(sourceFTP));\r
+\r
 \r
                 FtpReply sourceReplyTYPE = sourceFTP.Execute("TYPE I");\r
                 if (!sourceReplyTYPE.Success)\r
                     throw new Exception(sourceReplyTYPE.ErrorMessage);\r
 \r
+                logger.Info("4 " + IsNexioServer(sourceFTP));\r
+\r
                 if (input.LastIndexOf("/") == 0)\r
                     input = input.Replace("/", "");\r
                 FtpReply replyRETR = sourceFTP.Execute("RETR " + input);\r
@@ -83,6 +91,8 @@ namespace MaestroShared.Targets {
                         throw new Exception(replyRETR.ErrorMessage);\r
                 }\r
 \r
+                logger.Info("5 " + IsNexioServer(sourceFTP));\r
+\r
                 FtpReply targetReplyTYPE = targetFTP.Execute("TYPE I");\r
                 if (!targetReplyTYPE.Success)\r
                     throw new Exception(targetReplyTYPE.ErrorMessage);\r
@@ -101,10 +111,9 @@ namespace MaestroShared.Targets {
                     throw new Exception(targetReplyTYPE.ErrorMessage);\r
                 //if (!FileExists(OutputName))\r
                 //    throw new Exception("A cél állomány nem jött létre.");\r
-                long overall = 0;\r
                 long lastSize = 0;\r
-                while (overall != ilength) {\r
-                    overall = monitorFTP.GetFileSize(OutputName);\r
+                while (uploadedFileLength != sourceFileLength) {\r
+                    uploadedFileLength = monitorFTP.GetFileSize(OutputName);\r
                     /*\r
                     FtpReply statRETR = sourceFTP.Execute("STAT");\r
                     if (!statRETR.Success)\r
@@ -112,37 +121,37 @@ namespace MaestroShared.Targets {
                     else\r
                         Debug.WriteLine($"Overall {overall}, last {lastSize} site {statRETR.Message}");\r
 */\r
-                    if (overall == lastSize && overall > 0) {\r
+                    if (uploadedFileLength == lastSize && uploadedFileLength > 0) {\r
                         Progress = 100;\r
                         break;\r
                     } else {\r
-                        int currentProgress = (int)((double)overall / ilength * 100);\r
+                        int currentProgress = (int)((double)uploadedFileLength / sourceFileLength * 100);\r
                         Progress = currentProgress > 100 ? 100 : currentProgress;\r
-                        lastSize = overall;\r
+                        lastSize = uploadedFileLength;\r
                     }\r
                     Thread.Sleep(1000);\r
                 }\r
-\r
-                /* Ezen még agyalni kell               \r
-                if (!Parameters.TargetConfig.NexioServer) {\r
-                    //-1 -et ad???\r
-                    long uploadedSize = targetFTP.GetFileSize(OutputName);\r
-                    if (ilength != uploadedSize)\r
-                        throw new Exception(UPLOAD_SIZE_ERROR);\r
-                }\r
-                */\r
             }\r
             catch (Exception e) {\r
                 throw e;\r
             }\r
-            finally {\r
-                TerminateClient(monitorFTP);\r
-                TerminateClient(sourceFTP);\r
-            }\r
 \r
             //logger.Debug("Done");\r
         }\r
 \r
+        protected override void ValidateTransfer() {\r
+            if (!IsNexioServer(sourceFTP) && !IsNexioServer(monitorFTP)) {\r
+                if (sourceFileLength != uploadedFileLength)\r
+                    throw new Exception(COPY_SIZE_ERROR);\r
+            }\r
+        }\r
+\r
+        protected override void AfterExecute() {\r
+            base.AfterExecute();\r
+            TerminateClient(monitorFTP);\r
+            TerminateClient(sourceFTP);\r
+        }\r
+\r
 \r
     }\r
 }\r