Stremio / stremio-addon-sdk

🧙 A Node.js SDK for creating and publishing Stremio add-ons
https://www.stremio.com/addon-sdk
MIT License
605 stars 158 forks source link

Feature Request. Trakt scrobbling for custom media IDs #277

Open sutulustus opened 1 month ago

sutulustus commented 1 month ago

Hello,

I'm currently developing a Stremio addon aimed at serving streams from my database. Most features are operational, except for one particular functionality that I'm struggling to implement.

The problem lies with Trakt scrobbling not functioning properly for videos provided by my addon. After some investigation, I suspect this issue arises because I'm using custom video IDs for the catalogs I'm providing, which are then matched with videos in my database.

I couldn't locate any documentation on how Trakt matching operates within Stremio. Interestingly, when I utilize my addon to provide streams for the Cinemeta library by matching them with IMDB IDs, Trakt successfully tracks my progress. However, when employing my internal video IDs, Trakt fails to scrobble the video progress.

My primary query is whether it's necessary to format all my video IDs in catalogs in the Cinemeta style (e.g., tt123456 or tt123456:2:10) for Trakt scrobbling to function, or if there's a method to instruct Stremio on how to match the Trakt database. For instance, can I provide a parameter in the stream object or even the meta object on movies or episodes to facilitate this?

The crux of the issue is that while I have all my movies in my database matched to Trakt, I lack IMDB IDs for some videos, particularly older movies.

My preference would be to tell stremio in movie or series meta:

{
  metas: [
    {
      id: "my_internal_db_id",
      imdb_id: "tt0096697",
      trakt_id: "shows:455",
      name: "Simpsons"
    }
  ]
}

or even in stream behaviorHints

{
  streams: [
    {
      name: "",
      url: "video url",
      behaviorHints: {
        trakt_id: "episode:25734",
      }
    }
  ]
}

Any guidance or insight you can provide would be greatly appreciated.

Thank you.