iamkroot / trakt-scrobbler

Scrobbler for trakt.tv that supports VLC, Plex, MPC-HC, and MPV.
https://github.com/iamkroot/trakt-scrobbler/wiki
GNU General Public License v2.0
464 stars 30 forks source link

[BUG] `X-Men '97` is incorrectly recognized as "Mad Man" #286

Closed soredake closed 7 months ago

soredake commented 8 months ago

Describe the bug

X-Men '97 is incorrectly recognized as "Mad Man"

Desktop (please complete the following information):

To Reproduce

Steps to reproduce the behavior:

  1. Name file "X-Men '97 - S01E03 - Fire Made Flesh WEBDL-1080p.mkv"
  2. Open it.
  3. trakt-scrobbler will recognize it as "Mad Men S01E03", which is incorrect

Log file

Click to see log contents

``` 2024-03-27 17:07:59,991 - DEBUG - mpv - file_info - Raw filepath "C:\\Users\\user\\shared-unruhe\\non-anime\\X-Men '97\\Season 1\\X-Men '97 - S01E03 - Fire Made Flesh WEBDL-1080p.mkv" 2024-03-27 17:07:59,995 - DEBUG - mpv - file_info - Matched whitelist entry WindowsPath('C:/Users/user/shared-unruhe/non-anime') 2024-03-27 17:08:00,044 - DEBUG - mpv - file_info - Guess: MatchesDict({'title': ['X', "Men '97"], 'season': 1, 'episode_title': "X-Men '97", 'episode': 3, 'source': 'Web', 'screen_size': '1080p', 'container': 'mkv', 'mimetype': 'video/x-matroska', 'type': 'episode'}) 2024-03-27 17:08:00,044 - DEBUG - mpv - monitor - action=scrobble 2024-03-27 17:08:00,046 - DEBUG - mpv - monitor - {'state': 2, 'progress': 0.13, 'media_info': {'type': 'episode', 'title': "X Men '97", 'season': 1, 'episode': 3}, 'updated_at': 1711552080.044965} 2024-03-27 17:08:00,046 - DEBUG - scrobbler - scrobbler - Scrobbling start at 0.13% for X Men '97 2024-03-27 17:08:00,843 - INFO - scrobbler - scrobbler - Scrobble start successful for Mad Men S01E03 at 0.13% 2024-03-27 17:08:10,986 - DEBUG - mpv - monitor - action=scrobble 2024-03-27 17:08:10,986 - DEBUG - mpv - monitor - {'state': 0, 'progress': 0.73, 'media_info': {'type': 'episode', 'title': "X Men '97", 'season': 1, 'episode': 3}, 'updated_at': 1711552090.9863975} 2024-03-27 17:08:10,987 - DEBUG - mpv - mpv - Pipe closed. 2024-03-27 17:08:10,987 - DEBUG - scrobbler - scrobbler - Scrobbling stop at 0.73% for X Men '97 2024-03-27 17:08:11,088 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path. 2024-03-27 17:08:11,562 - INFO - scrobbler - scrobbler - Scrobble pause successful for Mad Men S01E03 at 0.73% ```

guessit -i log:

❯ guessit -i '.\X-Men ''97 - S01E03 - Fire Made Flesh WEBDL-1080p.mkv'
For: .\X-Men '97 - S01E03 - Fire Made Flesh WEBDL-1080p.mkv
GuessIt found: {
    "title": "X-Men '97",
    "season": 1,
    "episode": 3,
    "episode_title": "Fire Made Flesh",
    "source": "Web",
    "screen_size": "1080p",
    "container": "mkv",
    "mimetype": "video/x-matroska",
    "type": "episode",
    "input_string": ".\\X-Men '97 - S01E03 - Fire Made Flesh WEBDL-1080p.mkv"
}
iamkroot commented 7 months ago

One thing I noticed is guessit gives different results if we include the folder name.

For: X-Men '97 - S01E03 - Fire Made Flesh WEBDL-1080p.mkv
GuessIt found: {
    "title": "X-Men '97",
    "season": 1,
    "episode": 3,
    "episode_title": "Fire Made Flesh",
    "source": "Web",
    "screen_size": "1080p",
    "container": "mkv",
    "mimetype": "video/x-matroska",
    "type": "episode"
}

For: X-Men '97/Season 1/X-Men '97 - S01E03 - Fire Made Flesh WEBDL-1080p.mkv
GuessIt found: {
    "title": [
        "X",
        "Men '97"
    ],
    "season": 1,
    "episode_title": "X-Men '97",
    "episode": 3,
    "source": "Web",
    "screen_size": "1080p",
    "container": "mkv",
    "mimetype": "video/x-matroska",
    "type": "episode"
}

Note how the title is split into two in the second example. That causes us to lose the hyphen. Again one of those bugs where the automatic parsing fails. We can't really specialcase for this. You could raise a bug on guessit repo for this. And the recommended fix on our side is to use the remap_rules.toml file https://github.com/iamkroot/trakt-scrobbler/wiki/Metadata-Remap