As brought up on #291, I get a TypeError exception when using the match.episode field on remap_rules.toml.
I'm guessing the Season/Episode fields overridden by the include_regexes expression are not being converted from Strings to Integers
Desktop (please complete the following information):
OS and Version: Win10
Python Version: 3.11
Player and Version: MPC-HC
To Reproduce
remap_rules.toml
[[rules]]
match.title = "Mashle - Magic and Muscles"
match.episode = "1:12"
match.season = 2
id.trakt_slug = "mashle-magic-and-muscles"
type = "episode"
season = 1
episode_delta = 12
.+?)\\\\+\\[(?P.+?)] (?P.+?) - (S0?(?P[0-9]+)E0?)?(?P[0-9]+( ?v\\d)?).*')
DEBUG - mpc-hc - file_info - Guess: {'title': 'Mashle - Magic and Muscles', 'release_group': 'DKB', 'alternate_name': 'MASHLE', 'season': '2', 'episode': '12', 'type': 'episode'}
ERROR - mpc-hc - __init__ - Unhandled exception
Traceback (most recent call last):
File "C:\Program Files\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "...\trakt_scrobbler\player_monitors\monitor.py", line 387, in run
self.handle_status_update()
File "...\trakt_scrobbler\player_monitors\monitor.py", line 338, in handle_status_update
current_state = self.parse_status(self.status)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\trakt_scrobbler\player_monitors\monitor.py", line 163, in parse_status
media_info = get_media_info(status['filepath'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\trakt_scrobbler\file_info.py", line 137, in get_media_info
guess = apply_remap_rules(file_path, guess)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\trakt_scrobbler\mediainfo_remap.py", line 308, in apply_remap_rules
upd = rule.apply(path, media_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\trakt_scrobbler\mediainfo_remap.py", line 235, in apply
match = self.match.match(path, media_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\trakt_scrobbler\mediainfo_remap.py", line 149, in match
if not self.episode.match(episode):
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\trakt_scrobbler\mediainfo_remap.py", line 43, in match
return self.start <= val and val <= self.end
^^^^^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'int' and 'str'
```
Describe the bug
As brought up on #291, I get a
TypeError
exception when using thematch.episode
field onremap_rules.toml
. I'm guessing the Season/Episode fields overridden by theinclude_regexes
expression are not being converted from Strings to IntegersDesktop (please complete the following information):
To Reproduce
remap_rules.toml
config.yaml
Log file
Click to see log contents
```log DEBUG - mpc-hc - file_info - Raw filepath 'G:\\anime-seasonals\\[2024 Q1] Mashle - Magic and Muscles\\[DKB] MASHLE - S02E12 [1080p][END][HEVC x265 10bit][Multi-Subs].mkv' DEBUG - mpc-hc - file_info - Matched whitelist entry WindowsPath('G:/anime-seasonals') DEBUG - mpc-hc - file_info - Matched regex pattern re.compile('.*Q[1-4]] (?P