Skip to content

Commit 95e5793

Browse files
author
RandomEngy
committed
Fix problem where blu-ray folders wouldn't get the right {source} for auto-naming.
1 parent 4bfda3d commit 95e5793

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

VidCoder/Utilities/Utilities.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,15 @@ public static string GetSourceNameFile(string videoFile)
374374

375375
public static string GetSourceNameFolder(string videoFolder)
376376
{
377-
DirectoryInfo parentDirectory = Directory.GetParent(videoFolder);
377+
// If the directory is not VIDEO_TS, take its name for the source name (Blu-ray)
378+
var videoDirectory = new DirectoryInfo(videoFolder);
379+
if (videoDirectory.Name != "VIDEO_TS")
380+
{
381+
return videoDirectory.Name;
382+
}
383+
384+
// If the directory is named VIDEO_TS, take the source name from the parent folder (DVD)
385+
DirectoryInfo parentDirectory = videoDirectory.Parent;
378386
if (parentDirectory == null || parentDirectory.Root.FullName == parentDirectory.FullName)
379387
{
380388
return "VideoFolder";
@@ -385,8 +393,6 @@ public static string GetSourceNameFolder(string videoFolder)
385393
}
386394
}
387395

388-
389-
390396
public static void SetDragIcon(DragEventArgs e)
391397
{
392398
var data = e.Data as DataObject;

VidCoder/ViewModel/MainViewModel.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,6 @@ public void SetSourceFromFolder(string videoFolder)
237237
Settings.Default.LastVideoTSFolder = videoFolder;
238238
Settings.Default.Save();
239239
this.SourceName = Utilities.GetSourceNameFolder(videoFolder);
240-
//DirectoryInfo parentDirectory = Directory.GetParent(videoFolder);
241-
//if (parentDirectory == null || parentDirectory.Root.FullName == parentDirectory.FullName)
242-
//{
243-
// this.sourceName = "VideoFolder";
244-
//}
245-
//else
246-
//{
247-
// this.sourceName = parentDirectory.Name;
248-
//}
249240

250241
this.StartScan(videoFolder);
251242

0 commit comments

Comments
 (0)