Error with folders with \ or ending with a space character in windows
jaum20 opened this issue · comments
Describe the bug
Scripts breaks if there are some folder name with \ or ending with a space character
To Reproduce
Steps to reproduce the behaviour:
- Create a folder in your Google Drive with a space in the end of the name and puth some files there. e.g. "series a ": series/series a /season1
- try to create strm files for that folder
- Error: `The system cannot find the specified path: 'C:\kodi-strm\users\user\series\series a \season1'
Expected behaviour
script handles the spaces and backslashs and do no break
Please fill the following information:
- OS: Windows
- Browser brave
Packages Installed:
packages.txt
Additional context
Hm, to side-step the error occurring when a directory contains an extra space I guess I'll just have the script trim the name of each file/directory before using it — there's not much that can be done, most OSes do not allow creating directories with spaces in the end (many of them will silently trim the spaces without informing the user)
As for the error with the blackslash — I do remember* that being deliberate, different OS prohibit different characters from being included in file/directory name. Attempting to keep a track of them, and figure out a work-around would be taxing and pointless
Plus, what should be done with these characters? If a file is name "Episode 1: The First Episode" — should the script remove the colon, replace it with other character, and if so, replace it with what? At the end, I simply left it to the end-users of kodi-strm
— you are free to make changes to the original file directly on Drive! All kodi-strm
will do is act as a simple script and generate a local STRM file for that file! It won't attempt to guess what a file should have been named
* My memory is horrible; I do remember at some point I tried to work-around illegal characters as well — don't remember if that was in v1
or a feature branch that didn't make it to master
— but, I ran into the same problems that I mentioned above