l3uddz / plex_autoscan

Script to assist sonarr/radarr with plex imports. Will only scan the folder that has been imported, instead of the whole library section.
GNU General Public License v3.0
396 stars 70 forks source link

library path makes section mapping crash #164

Open Antaneyes opened 3 years ago

Antaneyes commented 3 years ago

Describe the bug when I put something new in drive, it generates an exception.

To Reproduce add something to the drive

Expected behavior Section mapping should be done properly.

Logs ERROR - UTILS [139967663843072]: Exception while trying to map 'Mi unidad/Joshua/Plex/Peliculas/Copia de El prado.mkv' to a Section ID in the Plex DB: Traceback (most recent call last): File "/opt/plex_autoscan/utils.py", line 33, in get_plex_section if path.startswith(root_path + os.sep): UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 48: ordinal not in range(128)

System Information

Tomarok commented 3 years ago

Same problem for me

bison529 commented 3 years ago

I found this solution in Discord:

in utils.py in /plex_autoscan i added the following 2 lines :

reload(sys) sys.setdefaultencoding("utf-8")

Tomarok commented 3 years ago

Work for me, thanks @bison529