using MaestroShared.Resources;\r
using MaestroShared.Target;\r
using MaestroShared.Targets;\r
+using Newtonsoft.Json;\r
using System;\r
using System.Collections.Generic;\r
using System.Diagnostics;\r
doc.Load(discMeta);\r
\r
string itemHouseId = null;\r
+ string discName = null;\r
try {\r
XmlNode node = doc.DocumentElement.GetElementsByTagName("UserDiscId")[0];\r
itemHouseId = node.Attributes["value"].Value;\r
+ node = doc.DocumentElement.GetElementsByTagName("MainTitle")[0];\r
+ discName = node.Attributes["usAscii"].Value;\r
+\r
} catch {\r
logger.Info("discmeta.xml doesn't contains UserDiscId, skipping auto process");\r
return;\r
\r
\r
if (MsgBox.YesNoQuestion("Új betöltendő tartalmat deketáltam. Indulhat az automatikus betöltés?"))\r
- BeginInvoke(new Action(() => AutoProcess(files, target, itemHouseId)));\r
+ BeginInvoke(new Action(() => AutoProcess(files, target, itemHouseId, discName)));\r
\r
}\r
\r
- private void AutoProcess(string[] files, Target target, string itemHouseId) {\r
+ private void AutoProcess(string[] files, Target target, string itemHouseId, string discName) {\r
\r
long count = files.Count() / 2;\r
logger.Info($"Auto processing {count} items");\r
string proxy = file.Replace("\\Clip\\", "\\Sub\\");\r
proxy = proxy.Substring(0, proxy.LastIndexOf(".")) + "S01" + proxy.Substring(proxy.LastIndexOf("."));\r
\r
+\r
FileInfo proxyFi = new FileInfo(proxy);\r
if (!proxyFi.Exists) {\r
logger.Info($"Proxy {proxy} not exists, skipping {file}");\r
continue;\r
}\r
\r
+ logger.Info($"Using proxy {proxy}");\r
+\r
TargetProcessorParameter processorParameter = null;\r
try {\r
//mxf metadata + duration\r
metadata.mediaHouseId = metadata.mediaTitle;\r
metadata.mediaTitle = sourceItem.FileInfo.Name;\r
processorParameter = CreateProcessorParameter(target, sourceItem, metadata, DateTime.Now, null);\r
+\r
+\r
+ var serializedTargetConfig = JsonConvert.SerializeObject(processorParameter.TargetConfig);\r
+ Target targetConfig = JsonConvert.DeserializeObject<Target>(serializedTargetConfig);\r
+ targetConfig.OutputFormat = discName + "-" + targetConfig.OutputFormat;\r
+\r
+ processorParameter.TargetConfig = targetConfig;\r
processorParameter.ProxyPath = proxy;\r
} catch (Exception e) {\r
logger.Error(e.Message);\r
// You can specify all the values or you can default the Build and Revision Numbers\r
// by using the '*' as shown below:\r
// [assembly: AssemblyVersion("1.0.*")]\r
-[assembly: AssemblyVersion("2.1.1.0")]\r
-[assembly: AssemblyFileVersion("2.1.1.0")]\r
+[assembly: AssemblyVersion("2.1.1.1")]\r
+[assembly: AssemblyFileVersion("2.1.1.1")]\r
{ "mediaCubeMedia", selectedMetadata.RedefineMedia.Serialize() }\r
};\r
logger.Info("Submitting {0}", data.ToString());\r
- api.SubmitJob(mediaCubeMetadata.JobTemplate, data);\r
+ api.SubmitJob(mediaCubeMetadata.JobTemplate, "Visszatöltés", data);\r
}\r
\r
private void RestoreMedia_FormClosing(object sender, FormClosingEventArgs e) {\r
// You can specify all the values or you can default the Build and Revision Numbers\r
// by using the '*' as shown below:\r
// [assembly: AssemblyVersion("1.0.*")]\r
-[assembly: AssemblyVersion("2.1.0.6")]\r
-[assembly: AssemblyFileVersion("2.1.0.6")]\r
+[assembly: AssemblyVersion("2.1.0.7")]\r
+[assembly: AssemblyFileVersion("2.1.0.7")]\r
}\r
}\r
\r
+ protected override void UploadProxy() {\r
+ throw new Exception("Proxy upload not supported in FTPTargetProcessor!");\r
+ }\r
protected override void UploadContent(string outputPath, byte[] content) {\r
using (Stream ostream = targetFTP.OpenWrite(outputPath, FtpDataType.Binary, false)) {\r
try {\r
protected FileInfo inputFile;\r
protected string workingDir;\r
private string sourcePath;\r
+ private int CurrentFileVersion = 0;\r
\r
public WorkflowAction workFlowAction { get; set; }\r
\r
protected virtual void UploadProxy() {\r
int pbCancel = 0;\r
string outputPath = Path.GetDirectoryName(Output);\r
- string outputFile = Path.GetFileName(Parameters.ProxyPath);\r
+\r
+ string nameWithoutExtension = GetDynamicText(Parameters.TargetConfig.OutputFormat);\r
+ string extension = Path.GetExtension(Parameters.ProxyPath);\r
+\r
+ if (CurrentFileVersion > 0)\r
+ nameWithoutExtension += "-" + CurrentFileVersion;\r
+\r
+ string outputFile = nameWithoutExtension + "S01" + extension;\r
+ outputFile = outputFile.ToUpper();\r
\r
string targetFilePath = Path.Combine(outputPath, STATUS_FOLDER, outputFile);\r
EnsureDirectoryExistence(Path.GetDirectoryName(targetFilePath));\r
}\r
\r
private bool doCopy(ref int pbCancel, string sourceFilePath, string targetFilePath) {\r
- return Win32File.CopyFileEx(Input, targetFilePath, new CopyProgressRoutine(this.CopyProgressHandler), IntPtr.Zero, ref pbCancel, CopyFileFlags.COPY_FILE_RESTARTABLE);\r
+ logger.Info($"doCopy {sourceFilePath} -> {targetFilePath}");\r
+ return Win32File.CopyFileEx(sourceFilePath, targetFilePath, new CopyProgressRoutine(this.CopyProgressHandler), IntPtr.Zero, ref pbCancel, CopyFileFlags.COPY_FILE_RESTARTABLE);\r
}\r
\r
private bool doAlternateCopy(string sourceFilePath, string targetFilePath) {\r
+ logger.Info($"doAlternateCopy {sourceFilePath} -> {targetFilePath}");\r
CustomFileCopier copier = new CustomFileCopier(sourceFilePath, targetFilePath);\r
copier.OnProgressChanged += Copier_OnProgressChanged;\r
copier.Copy();\r
extension = extension.ToUpper();\r
string result = string.Format(FILENAME, nameWithoutExtension, extension);\r
if (!Parameters.TargetConfig.DisableFileVersioning) {\r
- int version = 1;\r
+ logger.Info($"File versioning is enabled");\r
while (FileExists(GetOutputFilePath(workingDir, result))) {\r
- string versioned = string.Format(VERSIONED_FILENAME, nameWithoutExtension, version, extension);\r
+ CurrentFileVersion++;\r
+ string versioned = string.Format(VERSIONED_FILENAME, nameWithoutExtension, CurrentFileVersion, extension);\r
logger.Debug(ALREADY_EXISTS, result, versioned);\r
result = versioned;\r
- version++;\r
}\r
}\r
logger.Trace(Strings.EXIT);\r
private String colorSpace;\r
private int audioStreams;\r
private int videoStreams;\r
+ private int height;\r
+ private int width;\r
\r
public MediaInfo(Path filePath) {\r
this.filePath = filePath;\r
return frames;\r
}\r
\r
+ public int getHeight() {\r
+ return height;\r
+ }\r
+\r
public int getVideoStreams() {\r
return videoStreams;\r
}\r
\r
+ public int getWidth() {\r
+ return width;\r
+ }\r
+\r
public void process() throws InterruptedException, IOException {\r
Demuxer demuxer = null;\r
try {\r
if (frames == 0)\r
frames = stream.getDuration();\r
colorSpace = decoder.getPixelFormat().toString();\r
+\r
+ height = decoder.getHeight();\r
+ width = decoder.getWidth();\r
+\r
}\r
if (decoder.getCodecType() == MediaDescriptor.Type.MEDIA_AUDIO) {\r
audioStreams++;\r