Advertisement
ivandrofly

subtitle edit: visual-sync; code snippet

Mar 22nd, 2019
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1.  
  2.                 // O(n^2)
  3.                 /*
  4.                 foreach (var file in Directory.GetFiles(parentDir, "*"))
  5.                 {
  6.                     // not video file in directory where the subtitle is located
  7.                     if (Utilities.VideoFileExtensions.Contains(Path.GetExtension(file)) == false)
  8.                     {
  9.                         continue;
  10.                     }
  11.  
  12.                     string name = Path.GetFileNameWithoutExtension(file);
  13.                     string subtitleFileName = Path.GetFileName(_subtitleFileName);
  14.  
  15.                     // video file found!
  16.                     if (subtitleFileName.StartsWith(name, StringComparison.OrdinalIgnoreCase))
  17.                     {
  18.                         VideoFileName = file;
  19.                         break;
  20.                     }
  21.                 }
  22.                 */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement