zerratar / SubSync

Automatically download subtitles for your movies
MIT License
289 stars 26 forks source link

Crashes with too long paths #1

Closed beddet closed 6 years ago

beddet commented 6 years ago

If being run and it finds files in sub directories it crashes with the PathTooLongException and you have to run it again. Would be nice if it didn't crash and instead just ignores it. Potentially make a log of ignored files / output to console.

Unhandled Exception: System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. at System.IO.PathHelper.GetFullPathName() at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths) at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths) at System.IO.Path.GetFullPathInternal(String path) at System.IO.FileInfo.Init(String fileName, Boolean checkHost) at System.IO.FileInfo..ctor(String fileName) at SubSync.Processors.SubSyncMediaWatcher.IsSynchronized(String filePath) at SubSync.Processors.SubSyncMediaWatcher.Sync(String fullFilePath) at SubSync.Extensions.EnumerableExtensions.ForEach[T](IEnumerable1 enumerable, Action1 body) at SubSync.Processors.SubSyncMediaWatcher.SyncAll() at SubSync.Processors.SubSyncMediaWatcher.Start() at SubSync.Program.Main(String[] args)

zerratar commented 6 years ago

Thanks for the great find Beddet! I will fix this right away.

zerratar commented 6 years ago

@beddet I've pushed a potential fix for this and updated the binary zip as well. Could you try it out and see if it works for you now? Would totally appreciate it if you could.

zerratar commented 6 years ago

I've been able to test and now fixed completely. So super long paths will work fine without giving you an error.