Skip to content

Commit 9660d1b

Browse files
author
RandomEngy
committed
Fix output to source directory not working for batched files.
1 parent e898faa commit 9660d1b

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

VidCoder/ViewModel/Components/OutputPathViewModel.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ public string TranslateDvdSourceName(string dvdSourceName)
445445
return string.Join(" ", translatedTitleWords);
446446
}
447447

448-
public string BuildOutputPath(string fileName, string extension, string sourcePath)
448+
public string GetOutputFolder(string sourcePath)
449449
{
450450
// Use our default output folder by default
451451
string outputFolder = Settings.Default.AutoNameOutputFolder;
@@ -464,6 +464,13 @@ public string BuildOutputPath(string fileName, string extension, string sourcePa
464464
}
465465
}
466466

467+
return outputFolder;
468+
}
469+
470+
public string BuildOutputPath(string fileName, string extension, string sourcePath)
471+
{
472+
string outputFolder = GetOutputFolder(sourcePath);
473+
467474
if (!string.IsNullOrEmpty(outputFolder))
468475
{
469476
string result = Path.Combine(outputFolder, fileName + extension);

VidCoder/ViewModel/Components/ProcessingViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,13 +823,14 @@ public void QueueMultiple(IEnumerable<string> filesToQueue)
823823
foreach (string fileToQueue in filesToQueue)
824824
{
825825
excludedPaths.Add(fileToQueue);
826-
string queueOutputPath = Path.Combine(Settings.Default.AutoNameOutputFolder, Path.GetFileNameWithoutExtension(fileToQueue) + this.outputVM.GetOutputExtensionForCurrentEncodingProfile());
826+
string outputFolder = this.outputVM.GetOutputFolder(fileToQueue);
827+
string queueOutputPath = Path.Combine(outputFolder, Path.GetFileNameWithoutExtension(fileToQueue) + this.outputVM.GetOutputExtensionForCurrentEncodingProfile());
827828
queueOutputPath = this.outputVM.ResolveOutputPathConflicts(queueOutputPath, excludedPaths, isBatch: true);
828829

829830
// Even if you're doing overwrite don't try to stomp on the source file.
830831
if (string.Compare(queueOutputPath, fileToQueue, StringComparison.OrdinalIgnoreCase) == 0)
831832
{
832-
queueOutputPath = Utilities.CreateUniqueFileName(Path.GetFileNameWithoutExtension(fileToQueue) + this.outputVM.GetOutputExtensionForCurrentEncodingProfile(), Settings.Default.AutoNameOutputFolder, excludedPaths);
833+
queueOutputPath = Utilities.CreateUniqueFileName(Path.GetFileNameWithoutExtension(fileToQueue) + this.outputVM.GetOutputExtensionForCurrentEncodingProfile(), outputFolder, excludedPaths);
833834
}
834835

835836
excludedPaths.Add(queueOutputPath);

0 commit comments

Comments
 (0)