ZeroQI / Absolute-Series-Scanner

Seasons, absolute mode, Subfolders...
995 stars 155 forks source link

Special Character causes a crash during scanning #442

Open efalsken opened 1 year ago

efalsken commented 1 year ago

Scanner Log:

Jun 19, 2023 20:38:38.554 [140589647653696] ERROR - Error in Python: Running scanner:
Traceback (most recent call last):
  File "/config/Library/Application Support/Plex Media Server/Scanners/Series/Absolute Series Scanner.py", line 1316, in Scan
    Scan(path, sorted(subdir_files), media, sorted(subdir_dirs), language=language, root=root, kwargs_trigger=True)  #relative path for dir or it will show only grouping folder series
  File "/config/Library/Application Support/Plex Media Server/Scanners/Series/Absolute Series Scanner.py", line 1190, in Scan
    standard_holding.append([file, root, path, show, season, int(ep), title, year, int(ep2) if ep2 and ep2.isdigit() else None, rx, tvdb_mapping, unknown_series_length, offset_season, offset_episode, mappingList])
ValueError: invalid literal for int() with base 10: '\xb2'
Jun 19, 2023 20:38:38.561 [140589647653696] ERROR - We got an error scanning in /data/Videos/Anime
Jun 19, 2023 20:40:09.080 [140589647653696] WARN - Scanning the location /data/Videos/Anime did not complete

The file in question was: [Anime Time] Neon Genesis Evangelion - Death (True)².mkv

Apparently, the code that was trying to identify the episode number thought that the ^2 superscript was a digit. I'd recommend an extra regex filter [0-9] if your environment not support the \d subclass.

ZeroQI commented 1 year ago

Am really bad at unicode and other strings, so do not have the level to fix.

efalsken commented 1 year ago

This throws and causes the entire scan to halt without any feedback on what file caused the problem. I had to go through everything that I had added to find it.

ZeroQI commented 1 year ago

I understand the implications perfectly, however am still ill equipped to deal with such string coding issues. Does it crash plex scanner as well?

efalsken commented 1 year ago

Yes. The scanning terminates in full when encountering this file name and no further library updates happen. I'm good with regex and can help. Hit me up in discord.