zerratar / SubSync

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

Syncing a root drive fails #17

Open ForeverZer0 opened 6 years ago

ForeverZer0 commented 6 years ago

I have an external HDD I use for storing movies on, where the root is F: (on my PC), and it simply contains folders containing movies. The problem is trying to get subs recursively. There are obviously some hidden system folders like F:\$RECYCLE.BIN which will crash the program when it attempts to access them.

I had a previous issue myself on minor personal project before, and found it could be easily solved while enumerating directories with something akin to this:

var info = new DirectoryInfo(path);
var root = info.Root.FullName == info.FullName;
if (!root && info.Attributes.HasFlag(FileAttributes.System))
    continue;
zerratar commented 6 years ago

Good catch and thank you for reporting this issue, @ForeverZer0 !

I will fix this as soon as I get some time. Most likely tomorrow. =) I hope you can wait till then.

ForeverZer0 commented 6 years ago

No, problem, and no hurry either. It is easy oversight (speaking from first-hand experience, lol). 👍

zerratar commented 6 years ago

@ForeverZer0 Unfortunately I didn't have enough time on my hands after all to create a fix when I told you I would. I did get a couple of minutes over just now so I have uploaded a temporarily and hopefully working solution for now. If you can try it out and see if it works for you; and report back, I would appreciate it a lot :-)

And thank you for your patience!