File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments