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
395 stars 70 forks source link

Accentuation in library path makes section mapping crash #129

Open RomLecat opened 4 years ago

RomLecat commented 4 years ago

Describe the bug When Plex Autoscan tries to map Section ID to path, if path is containing an accentuation (such as "é"), it generates an exception.

To Reproduce Have a library mapped to a path with "é" character. Start a scan.

Expected behavior Section mapping should be done properly.

Logs

 2019-12-15 19:41:44,281 -    ERROR -     UTILS [139817094105888]: Exception while trying to map 'REDACTED' 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 7: ordinal not in range(128)

System Information