Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special chars in camera name #8

Open
pengu-fr opened this issue Dec 28, 2023 · 3 comments
Open

Special chars in camera name #8

pengu-fr opened this issue Dec 28, 2023 · 3 comments

Comments

@pengu-fr
Copy link

Hi,

Thanks for this lightweight NVR !

When using special chars in camera name (Séjour, Façade...), the directory includes single quotes (which isn't nice looking in the filesystem), and the recording fails. NVR: Recording for camera 'Façade' has stopped unexpectedly!
Indeed, the directory is created is : /storage/'Séjour'/raw/

I've seen a resolved issue about space in the name... I guess this is linked.

@pengu-fr
Copy link
Author

pengu-fr commented Dec 28, 2023

If I manually remove the quotes from the directory name, it's kinda working... : /storage/Séjour/raw/
recording are saved, but every minutes it writes a new file, and the log says :
NVR: Recording for camera 'Séjour' has stopped unexpectedly!

And... if I symlink the Séjour directory to 'Séjour'... then everything works as expected.
ln -sf Séjour/ 'Séjour'

@cyb3rdoc
Copy link
Owner

cyb3rdoc commented Nov 8, 2024

Yes, seems like problem due to shlex.quote() which was implemented to resolve space issue. To handle that, space or non-alphanumeric characters can be converted to undersocre "_" and for your special character issue, we can covert accented characters into their base form (e.g., "é" -> "e", "ç" -> "c"). I have updated the code with possible fix in 'dev' branch and docker image with 'dev' tag. Please check and let me know if this fixes your issue.

@pengu-fr
Copy link
Author

Thank you for working on this.
I'm not sure replacing all non ASCII char to '_' is the way to go here.
As long as the filesystem allow them, why would ez-nvr replace these chars ?
I'm not a python developper, but maybe this library could help you : https://pathvalidate.readthedocs.io/

Sanitize will remove invalid characters for a target platform (Linux, Windows, macOS, POSIX, universal)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants