asciidisco / plugin.video.netflix

Inputstream based Netflix plugin for Kodi
MIT License
1.23k stars 225 forks source link

[External service] Update watched state trakt.tv #158

Open Norien opened 7 years ago

Norien commented 7 years ago

Just a feature request. It would be really nice if watched status would update inside trakt!

asciidisco commented 7 years ago

Don't know much about trakt (I´m not using it). If anyone wants to implement this, than the addition would be welcome.

tonyschuite commented 7 years ago

@asciidisco have a look here: https://github.com/trakt/script.trakt/wiki/Providing-id's-to-facilitate-scrobbling

razzeee commented 7 years ago

It's quiet trivial, if you can manage to get those ids from somewhere.

tonyschuite commented 7 years ago

perhaps we can get that info when #170 works?

asciidisco commented 7 years ago

Sure. I or @hawkeyexp will add a comment here, when the PR is merged. We can then go & somehow see if we can add the data fro trakt if available.

asciidisco commented 7 years ago

PR is merged, going to look into that. Maybe I´ll add a seperate setting, as I fear that fetching the data from the Kodi DB has a negative impact on performance. But that is up to be measured.

im85288 commented 7 years ago

If PR170 retrieves the DBID for the episode from the Kodi DB (and of course this is only for items added to the kodi db using the export to kodi function for strm files) then you can use a similar mechansim to what I use in the next up addon, where it uses the addon-signals addon to communicate with trakt directly.

# Signal to trakt previous episode watched AddonSignals.sendSignal("NEXTUPWATCHEDSIGNAL", {'episodeid': self.currentepisodeid})

The key 'NEXTUPWATCHEDSIGNAL' was what @Razzeee and I agreed on but he may be happy enough for you to use the same key.

If the item is not in the Kodi DB then it will need to follow the pattern linked above where it relies on ids such as:

{u'tmdb': 264660} {u'tvdb': 121361} {u'imdb': u'tt0470752'} {u'slug': u'ex-machina-2014'} {u'trakt': 163375}

gismo112 commented 7 years ago

Add in PR #233 the https://github.com/trakt/script.trakt/wiki/Providing-id's-to-facilitate-scrobbling for the exportet Movies/Shows (.strm-Files) where in KodiDB. The scrobbling for the not in Kodi-DB-Streams use to match the Name / Year search in Trakt and it works too.

Importend for all this is to set the "Offset scrobble start by x minutes" to 1 in the Trakt-Plugin-Settings. When playing DRM-Videos in a Plugin with inputstream_adaptive there stream startet a little to slow for Trakt to get the active player and then no scrobbling work for most times. With this setting it works fine.

tonyschuite commented 7 years ago

You are absolutely right! it's working...

Actually... come to think of it. I do not have those changes in my version and it works nonetheless...

gismo112 commented 7 years ago

When you mean, it working after Changing the Trakt-Settings, i can say yes (Sometimes it work without the Settings-Change). Then is the Name / Year scrobbling in work. This is good, but not perfect. With the ids we tell trakt the imdb / tvdb number of the video and this is perfect with no error-rate :-)

borgsten commented 7 years ago

This doesn't work if you have exported a whole series because then the metadata for the episodes does not necessary exist. Maybe this could be fixed by saving the metadata for the entire series automatically when doing an export.

Or is it possible to to get information from the item that "invokes" the play action and identify the title that way?

tonyschuite commented 7 years ago

I think that is what pull #233 is referring to...

gismo112 commented 7 years ago

@borgsten This is a another construction zone and have nothing to to with this fix for trakt. When you have Problems with the Metadata, open the Series-Folder you want one time before you export it to your db. Then is true, all Metadata are downloaded.