-
Notifications
You must be signed in to change notification settings - Fork 149
Providing id's to facilitate scrobbling
Movie & Episode scrobbling based on title and year matching is inherently error prone. To maximize accuracy when playing videos not in the Kodi library, addons can set a window property just before playback starts called "script.trakt.ids" on window 10000 describing the ids of the video being played.
The structure of this window property must be a json encoded string matching the structure of an "ids" trakt API object. The structure of the "ids" object is shown as part of the Trakt standard media objects.
"ids" object examples (worst to best):
{u'tmdb': 264660}
{u'tvdb': 121361}
{u'imdb': u'tt0470752'}
{u'slug': u'ex-machina-2014'}
{u'trakt': 163375}
One or more id values can be included at the same time:
{u'tmdb': 264660, u'imdb': u'tt0470752', u'slug': u'ex-machina-2014', u'trakt': 163375}
Example code:
ids = json.dumps({u'tmdb': 264660, u'imdb': u'tt0470752', u'slug': u'ex-machina-2014', u'trakt': 163375})
xbmcgui.Window(10000).setProperty('script.trakt.ids', ids)
If this property is not set before playback, the Trakt add-on will fallback to title and year matching if the user has enabled the option to do so in the Scrobbling tab of Trakt add-on settings. The Trakt addon will automatically reset the value of this property any time playback ends or stops.