From: Vásáry Dániel Date: Tue, 10 Oct 2017 09:43:11 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=fd652da75234d0a626d3e36e341ef998a07a282d;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30574 --- diff --git a/client/Maestro/Maestro.csproj b/client/Maestro/Maestro.csproj index a6f2da8f..48484cd1 100644 --- a/client/Maestro/Maestro.csproj +++ b/client/Maestro/Maestro.csproj @@ -27,10 +27,13 @@ false true http://10.10.1.28:90/clientinstall/ + Maestro + USER Rendszerház Kft. + MediaCube true index.htm - 3 - 1.9.0.3 + 0 + 1.9.0.0 false true true @@ -262,9 +265,21 @@ Settings.settings True + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/client/Maestro/Resources/configuration-fxp-isilon.json b/client/Maestro/Resources/configuration-fxp-isilon.json new file mode 100644 index 00000000..c5da3590 --- /dev/null +++ b/client/Maestro/Resources/configuration-fxp-isilon.json @@ -0,0 +1,62 @@ +{ + "title": "Adáslebonyolítás", + "active": false, + "startInTray": false, + "enableNameOverride": false, + "player": { + "enabled": true, + "autoStart": false, + "segmentEditor": true + }, + "source": { + "$type": "UNCSource", + "local": { + "address": "file://localhost/watch" + }, + "remote": { + "address": "ftp://localhost:21/watch", + "userName": "dani", + "password": "dani" + } + }, + "metadatas": [ + { + "$type": "OctopusMetadata", + "server": { + "address": "http://10.10.1.28:8080/services/rest/octopus", + "userName": "dani", + "password": "dani", + "timeout": 1000 + } + }, + { + "$type": "TrafficMetadata", + "server": { + "address": "Data Source=10.10.1.45\\sql16;Initial Catalog=PA_Echo;Persist Security Info=True;", + "userName": "MAM", + "password": "Echotv.hu", + "timeout": 5 + } + }, + { + "$type": "MediaCubeMetadata", + "server": { + "address": "http://10.10.1.28:8080/services/rest/jobengine", + "userName": "dani", + "password": "dani" + } + } + ], + "targets": [ + { + "label": "Adásba", + "processor": "FXPTargetProcessor", + "outputFormat": "%ID%", + "remote": { + "address": "ftp://10.10.1.100:21/READY", + "userName": "mediacube", + "password": "Broadca5T" + } + } + ] +} diff --git a/client/Maestro/Resources/configuration-fxp.json b/client/Maestro/Resources/configuration-fxp.json new file mode 100644 index 00000000..6077a557 --- /dev/null +++ b/client/Maestro/Resources/configuration-fxp.json @@ -0,0 +1,62 @@ +{ + "title": "Adáslebonyolítás", + "active": false, + "startInTray": false, + "enableNameOverride": false, + "player": { + "enabled": true, + "autoStart": false, + "segmentEditor": true + }, + "source": { + "$type": "UNCSource", + "local": { + "address": "file://localhost/watch" + }, + "remote": { + "address": "ftp://localhost:21/watch", + "userName": "dani", + "password": "dani" + } + }, + "metadatas": [ + { + "$type": "OctopusMetadata", + "server": { + "address": "http://10.10.1.28:8080/services/rest/octopus", + "userName": "dani", + "password": "dani", + "timeout": 1000 + } + }, + { + "$type": "TrafficMetadata", + "server": { + "address": "Data Source=10.10.1.45\\sql16;Initial Catalog=PA_Echo;Persist Security Info=True;", + "userName": "MAM", + "password": "Echotv.hu", + "timeout": 5 + } + }, + { + "$type": "MediaCubeMetadata", + "server": { + "address": "http://10.10.1.28:8080/services/rest/jobengine", + "userName": "dani", + "password": "dani" + } + } + ], + "targets": [ + { + "label": "Adásba", + "processor": "FXPTargetProcessor", + "outputFormat": "%ID%", + "remote": { + "address": "ftp://localhost:22/out", + "userName": "dani", + "password": "dani" + } + } + ] +} diff --git a/client/Maestro/Resources/configuration-ingest - Copy.json b/client/Maestro/Resources/configuration-ingest - Copy.json new file mode 100644 index 00000000..d382eb31 --- /dev/null +++ b/client/Maestro/Resources/configuration-ingest - Copy.json @@ -0,0 +1,77 @@ +{ + "title": "Betöltés", + "active": true, + "startInTray": false, + "enableCustomMetadataId": false, + "player": { + "enabled": true, + "autoStart": false, + "segmentEditor": false + }, + "source": { + "$type": "UNCSource", + "local": { + "address": "file://c:\\_video\\v\\sxs\\xdroot\\clip" + } + }, + "metadatas": [ + { + "$type": "OctopusMetadata", + "server": { + "address": "http://10.10.1.28:8080/services/rest/octopus/", + "userName": "user", + "password": "password", + "timeout": 1000 + } + }, + { + "$type": "TrafficMetadata", + "server": { + "address": "Data Source=10.10.1.45\\sql16;Initial Catalog=PA_Echo;Persist Security Info=True;", + "userName": "MAM", + "password": "Echotv.hu", + "timeout": 5 + } + }, + { + "$type": "MediaCubeMetadata", + "server": { + "address": "http://10.10.1.28:8080/services/rest/jobengine/", + "userName": "user", + "password": "password", + "timeout": 1000 + } + } + ], + "targets": [ + { + "label": "Híranyag betöltés", + "processor": "UNCTargetProcessor", + "outputFormat": "%ID%-%SOURCENAME%", + "tag": "Betöltés", + "createSubFolder": true, + "killDateDays": 7, + "useMetadata": false, + "remote": { + "address": "file://10.10.1.100/BRAAVOS/ARCHIVE", + "userName": "mediacube", + "password": "Broadca5T" + } + }, + { + "label": "Adásanyag betöltés", + "processor": "UNCTargetProcessor", + "outputFormat": "%ID%", + "tag": "Betöltés", + "saveSegments": false, + "killDateDays": 7, + "createSubFolder": false, + "useMetadata": false, + "remote": { + "address": "file://10.10.1.100/BRAAVOS/PLAYOUT_CHECK", + "userName": "mediacube", + "password": "Broadca5T" + } + } + ] +} diff --git a/client/Maestro/Resources/configuration-ingest.json b/client/Maestro/Resources/configuration-ingest.json new file mode 100644 index 00000000..afef4029 --- /dev/null +++ b/client/Maestro/Resources/configuration-ingest.json @@ -0,0 +1,78 @@ +{ + "title": "Betöltés", + "active": true, + "startInTray": false, + "enableCustomMetadataId": false, + "player": { + "enabled": true, + "autoStart": false, + "segmentEditor": false + }, + "source": { + "$type": "UNCSource", + "filter": "avi,wav,mxf", + "local": { + "address": "file://c:\\_video\\v\\sxs\\xdroot\\clip" + } + }, + "metadatas": [ + { + "$type": "OctopusMetadata", + "server": { + "address": "http://10.10.1.28:8080/services/rest/octopus/", + "userName": "user", + "password": "password", + "timeout": 1000 + } + }, + { + "$type": "TrafficMetadata", + "server": { + "address": "Data Source=10.10.1.45\\sql16;Initial Catalog=PA_Echo;Persist Security Info=True;", + "userName": "MAM", + "password": "Echotv.hu", + "timeout": 5 + } + }, + { + "$type": "MediaCubeMetadata", + "server": { + "address": "http://10.10.1.28:8080/services/rest/jobengine/", + "userName": "user", + "password": "password", + "timeout": 1000 + } + } + ], + "targets": [ + { + "label": "Híranyag betöltés", + "processor": "UNCTargetProcessor", + "outputFormat": "%ID%-%SOURCENAME%", + "tag": "Betöltés", + "createSubFolder": true, + "killDateDays": 7, + "useMetadata": false, + "remote": { + "address": "file://10.10.1.100/BRAAVOS/ARCHIVE", + "userName": "mediacube", + "password": "Broadca5T" + } + }, + { + "label": "Adásanyag betöltés", + "processor": "UNCTargetProcessor", + "outputFormat": "%ID%", + "tag": "Betöltés", + "saveSegments": false, + "killDateDays": 7, + "createSubFolder": false, + "useMetadata": false, + "remote": { + "address": "file://10.10.1.100/BRAAVOS/PLAYOUT_CHECK", + "userName": "mediacube", + "password": "Broadca5T" + } + } + ] +} diff --git a/client/Maestro/Resources/configuration-nexio.json b/client/Maestro/Resources/configuration-nexio.json index 0ac702f2..f0a69cb4 100644 --- a/client/Maestro/Resources/configuration-nexio.json +++ b/client/Maestro/Resources/configuration-nexio.json @@ -1,6 +1,6 @@ { - "title": "PLAYOUT", - "active": true, + "title": "Adáslebonyolítás", + "active": false, "startInTray": false, "enableNameOverride": false, "filter": "avi", diff --git a/client/Maestro/Resources/configuration-unc.json b/client/Maestro/Resources/configuration-unc.json index 2d40e582..f9c9112f 100644 --- a/client/Maestro/Resources/configuration-unc.json +++ b/client/Maestro/Resources/configuration-unc.json @@ -1,17 +1,15 @@ { "title": "INGEST", - "active": true, + "active": false, "startInTray": false, - "enableNameOverride": false, "enableCustomMetadataId": true, "player": { "enabled": true, "autoStart": false, - "segmentEditor": true + "segmentEditor": false }, "source": { "$type": "UNCSource", - "filter": "avi,wav,mxf", "local": { "address": "file://10.10.1.100/BRAAVOS/_TEST_/_ECHO/hirado/test" }, diff --git a/client/Maestro/Sources/NexioRESTSource.cs b/client/Maestro/Sources/NexioRESTSource.cs index ad86398c..5f15d6de 100644 --- a/client/Maestro/Sources/NexioRESTSource.cs +++ b/client/Maestro/Sources/NexioRESTSource.cs @@ -130,7 +130,7 @@ namespace Maestro.Sources { private void SetItem(ref NexioSourceItem item, JToken token) { item.ID = token[ID].ToString(); - item.Name = token[LONGNAMEID].ToString(); + item.Name = token[LONGNAMEID].ToString() + ".mxf"; //item.Created = DateTime.Parse(token[RECORDDATE].ToString()); item.Agency = token[EXTAGENCY].ToString(); item.Modified = DateTime.Parse(token[MODIFIED].ToString()); diff --git a/client/Maestro/Targets/FTPTargetProcessor.cs b/client/Maestro/Targets/FTPTargetProcessor.cs index 35a50856..73685440 100644 --- a/client/Maestro/Targets/FTPTargetProcessor.cs +++ b/client/Maestro/Targets/FTPTargetProcessor.cs @@ -16,15 +16,11 @@ namespace Maestro.Targets { public FTPTargetProcessor(Control parent, TargetProcessorParametersWrapper parameters) : base(parent, parameters) { FtpTrace.LogFunctions = false; - Uri inputUri = createInputUri(parameters); - inputFile = new FileInfo(inputUri.LocalPath); - Input = inputFile.FullName; - ID = parameters.ID; - workFlowAction = new WorkflowAction() { houseId = ID, tag = parameters.TargetConfig.Tag, touched = DateTime.Now }; - } - - protected virtual Uri createInputUri(TargetProcessorParametersWrapper parameters) { - return new Uri(String.Format("{0}/{1}", parameters.SourceConfig.Local.Address.LocalPath, parameters.InputFileName)); + if (!(parameters.SourceConfig is UNCSource)) { + inputFile = null; + Uri inputUri = new Uri(String.Format("{0}{1}", parameters.SourceConfig.Remote.Address, parameters.InputFileName)); + Input = inputUri.ToString(); + } } protected override void BeforeExecute() { diff --git a/client/Maestro/Targets/FXPTargetProcessor.cs b/client/Maestro/Targets/FXPTargetProcessor.cs index 1032b08e..ac53db52 100644 --- a/client/Maestro/Targets/FXPTargetProcessor.cs +++ b/client/Maestro/Targets/FXPTargetProcessor.cs @@ -11,14 +11,14 @@ namespace Maestro.Targets { public class FXPTargetProcessor : FTPTargetProcessor { private Logger logger = LogManager.GetCurrentClassLogger(); private Source sourceConfig; + Uri inputUri; public FXPTargetProcessor(Control parent,TargetProcessorParametersWrapper parameters) : base(parent, parameters) { sourceConfig = parameters.SourceConfig; - } + inputUri = new Uri(String.Format("{0}/{1}", parameters.SourceConfig.Remote.Address, parameters.InputFileName)); + Input = inputUri.ToString(); - protected override Uri createInputUri(TargetProcessorParametersWrapper parameters) { - return new Uri(String.Format("{0}/{1}", parameters.SourceConfig.Remote.Address, parameters.InputFileName)); } protected override void UploadFile() { @@ -27,7 +27,7 @@ namespace Maestro.Targets { try { sourceFTP = CreateClient(sourceConfig.Remote); - long ilength = sourceFTP.GetFileSize(inputFile.Name); + long ilength = sourceFTP.GetFileSize(inputUri.AbsolutePath); FtpReply replyPASV = targetFTP.Execute("PASV"); if (!replyPASV.Success) @@ -41,24 +41,34 @@ namespace Maestro.Targets { if (!replyPORT.Success) throw new Exception(replyPORT.ErrorMessage); - FtpReply replyTYPE = targetFTP.Execute("TYPE I"); - if (!replyTYPE.Success) - throw new Exception(replyTYPE.ErrorMessage); + + FtpReply sourceReplyTYPE = sourceFTP.Execute("TYPE I"); + if (!sourceReplyTYPE.Success) + throw new Exception(sourceReplyTYPE.ErrorMessage); + + FtpReply replyRETR = sourceFTP.Execute("RETR " + inputUri.AbsolutePath); + if (!replyRETR.Success) { + + replyRETR = sourceFTP.Execute("RETR " + inputUri.Segments[inputUri.Segments.Length - 1]); + + if (!replyRETR.Success) + throw new Exception(replyRETR.ErrorMessage); + } + + FtpReply targetReplyTYPE = targetFTP.Execute("TYPE I"); + if (!targetReplyTYPE.Success) + throw new Exception(targetReplyTYPE.ErrorMessage); FtpReply replySTOR = targetFTP.Execute("STOR " + OutputName); if (!replySTOR.Success) throw new Exception(replySTOR.ErrorMessage); - replyTYPE = sourceFTP.Execute("TYPE I"); - if (!replyTYPE.Success) - throw new Exception(replyTYPE.ErrorMessage); - - FtpReply replyRETR = sourceFTP.Execute("RETR " + inputFile.Name); - if (!replyRETR.Success) - throw new Exception(replyRETR.ErrorMessage); monitorFTP = CreateClient(parameters.TargetConfig.Remote); - + monitorFTP.SetWorkingDirectory(workingDir); + monitorFTP.Execute("TYPE I"); + if (!monitorFTP.FileExists(OutputName)) + throw new Exception("A cél állomány nem jött létre."); long overall = 0; while (overall != ilength) { overall = monitorFTP.GetFileSize(OutputName); diff --git a/client/Maestro/Targets/UNCTargetProcessor.cs b/client/Maestro/Targets/UNCTargetProcessor.cs index 34cd43ae..d45ed5ea 100644 --- a/client/Maestro/Targets/UNCTargetProcessor.cs +++ b/client/Maestro/Targets/UNCTargetProcessor.cs @@ -21,6 +21,7 @@ namespace Maestro.Targets { private const string STATUS_FOLDER = ".STATUS"; private const string KILLDATE_FILE = "{0}.{1}.killdate"; private const string METADATA_FILE = "{0}.json"; + private const string DEFAULT_EXTENSION = ".mxf"; protected FileInfo inputFile; protected string workingDir; protected TargetProcessorParametersWrapper parameters; @@ -43,7 +44,7 @@ namespace Maestro.Targets { } public override bool Execute() { - logger.Info(PROCESSING, inputFile.Name); + logger.Info(PROCESSING, InputName); bool result = false; try { BeforeExecute(); @@ -66,7 +67,7 @@ namespace Maestro.Targets { finally { AfterExecute(); } - logger.Info(PROCESSING_COMPLETED, inputFile.Name); + logger.Info(PROCESSING_COMPLETED, InputName); return result; } @@ -166,11 +167,13 @@ namespace Maestro.Targets { } protected virtual string CreateOutputFileName() { - string nameWithoutExtension = parameters.TargetConfig.OutputFormat.Replace("%ID%", ID).Replace("%SOURCENAME%", Path.GetFileNameWithoutExtension(inputFile.Name)); - string result = String.Format(FILENAME, nameWithoutExtension, inputFile.Extension); + string nameWithoutExtension = parameters.TargetConfig.OutputFormat.Replace("%ID%", ID).Replace("%SOURCENAME%", Path.GetFileNameWithoutExtension(InputName)); + + string extension = InputName.Contains(".") ? InputName.Substring(InputName.LastIndexOf(".")) : DEFAULT_EXTENSION; + string result = String.Format(FILENAME, nameWithoutExtension, extension); int version = 1; while (FileExists(Path.Combine(workingDir, result))) { - string versioned = String.Format(VERSIONED_FILENAME, nameWithoutExtension, version, inputFile.Extension); + string versioned = String.Format(VERSIONED_FILENAME, nameWithoutExtension, version, extension); logger.Debug(ALREADY_EXISTS, result, versioned); result = versioned; version++;