Skip to content

bug: Anime episode scrobble 404 when absolute order mismatch (Tautulli notificaion agent) #15

@dotneB

Description

@dotneB

Bug Report

scrobblex version: v1.5.1

Current behavior:

Webhook: Tautulli notification agent
Show: Kaiju No. 8
Season 2, Episode 4. Absolute order 16

In Plex, IMDB and Tautulli, it shows as Season 2 Episode 4
In Trakt and TMDB, it's shows as Season 1 Episode 16

[2025-08-12 20:27:00] debug:    🔥 Event: media.scrobble 🏷️ Type: episode 🔖 Title: The Man Called Isao Shinomiya 👤 dotneB
[2025-08-12 20:27:00] debug:    {
  "event": "media.scrobble",
  "server": "tautulli",
  "Account": {
    "title": "dotneB"
  },
  "Metadata": {
    "grandparentTitle": "Kaiju No. 8",
    "parentIndex": "2",
    "index": "4",
    "title": "The Man Called Isao Shinomiya",
    "type": "episode",
    "year": "2025",
    "Guid": [
      {
        "id": "imdb://tt21975436"
      },
      {
        "id": "tvdb://423075"
      },
      {
        "id": "tmdb://207468"
      }
    ]
  }
}
[2025-08-12 20:27:00] debug:    undefined / undefined
[2025-08-12 20:27:00] debug:    services and ids: [{"service":"imdb","id":"tt21975436"},{"service":"tvdb","id":"423075"},{"service":"tmdb","id":"207468"}]
[2025-08-12 20:27:00] debug:    [
  {
    "service": "imdb",
    "id": "tt21975436"
  },
  {
    "service": "tvdb",
    "id": "423075"
  },
  {
    "service": "tmdb",
    "id": "207468"
  }
]
[2025-08-12 20:27:01] error:    ❌ Request failed with status code 404

Expected behavior:

It could fallback to another method to attempt grab the episode guids from trakt.
Or await for this Tautulli issue Tautulli/Tautulli#2510 to be resolved to remove the tautulli specific requests for guids

Steps to reproduce:

Related code:

The request in

const getEpisodeId = await api.get(
`https://api.trakt.tv/shows/${imdbGuid.id}/seasons/${payload.Metadata.parentIndex}/episodes/${payload.Metadata.index}`,
{ ttl: 1000 * 60 * 180 },
);
to get the episode id, ends up calling https://api.trakt.tv/shows/tt21975436/seasons/2/episodes/4 which trakt replies with 404 because it's tracking Kaiju No.8 in absolute order. Manually testing calling https://api.trakt.tv/shows/tt21975436/seasons/1/episodes/16 returns the expected ids.

A possible fallback approach could be (in pseudo code)

  1. Try-catch that request
  2. If 404, verify if fallback method is needed
  3. Query https://api.trakt.tv/shows/tt21975436/seasons to find how many seasons it has, If it's smaller than Metadata.parentIndex, then it confirms the 404 was because of an absolute order problem.
  4. Fallback options
    4.1. Query https://api.trakt.tv/search/episode?query=${Metadata.title}, filters for [*].show.ids.imdb to match if multiple episodes of the same name are found for different shows
    4.2. Query https://api.trakt.tv/shows/tt21975436/seasons/1, and manually filters by title name.

Neither of those options are great since it assumes your library setting for episode names are going to match the languages

Other information:

Switching to using a plex webhook appears to have fixed the issue. Since I'm not entering

if (payload.server === 'tautulli') {
and plex does provide the correct guids for the episodes and doesn't require another round trip or fallback

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions