home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
Trakt for MP2
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ltfearme" data-source="post: 1140069" data-attributes="member: 52219"><p>Hey [USER=48495]@morpheus_xx[/USER], I don't believe the special permissions are available any more for the authentication method that MP1 uses <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" />, they deprecated it a few months ago when they added PinCode authentication. I haven't had much of a chance to look at the documentation for the new method simply because what I have now just works and was in no rush to break it again. Having said that, support will need to be added for MP2.</p><p></p><p>Another important thing comes to mind with respect to the v2 API is that it's important to cache everything. In the MP1 trakt plugin I have created a cache class (<a href="https://github.com/trakt/Trakt-for-Mediaportal/blob/master/TraktPlugin/TraktCache.cs" target="_blank">https://github.com/trakt/Trakt-for-Mediaportal/blob/master/TraktPlugin/TraktCache.cs</a>) which with a little tweak can easily be used in MP2 if you wanted (there is some references to the trakt plugin's log class and mediaportal config directory). </p><p></p><p>When a scheduled sync occurs I call <a href="https://github.com/trakt/Trakt-for-Mediaportal/blob/master/TraktPlugin/TraktCache.cs#L66" target="_blank">RefreshData()</a>, this will then pull down any user data on trakt if it has changed otherwise it just re-loads from persisted file on disk/memory. When RefreshData is complete I then can do a 2-way sync to/from local databases with corresponding data in the cache e.g. <a href="https://github.com/trakt/Trakt-for-Mediaportal/blob/master/TraktPlugin/TraktCache.cs#L249" target="_blank">TraktCache.GetCollectedMoviesFromTrakt()</a>, this will return immediately as the data is up to date.</p></blockquote><p></p>
[QUOTE="ltfearme, post: 1140069, member: 52219"] Hey [USER=48495]@morpheus_xx[/USER], I don't believe the special permissions are available any more for the authentication method that MP1 uses :(, they deprecated it a few months ago when they added PinCode authentication. I haven't had much of a chance to look at the documentation for the new method simply because what I have now just works and was in no rush to break it again. Having said that, support will need to be added for MP2. Another important thing comes to mind with respect to the v2 API is that it's important to cache everything. In the MP1 trakt plugin I have created a cache class ([URL]https://github.com/trakt/Trakt-for-Mediaportal/blob/master/TraktPlugin/TraktCache.cs[/URL]) which with a little tweak can easily be used in MP2 if you wanted (there is some references to the trakt plugin's log class and mediaportal config directory). When a scheduled sync occurs I call [URL='https://github.com/trakt/Trakt-for-Mediaportal/blob/master/TraktPlugin/TraktCache.cs#L66']RefreshData()[/URL], this will then pull down any user data on trakt if it has changed otherwise it just re-loads from persisted file on disk/memory. When RefreshData is complete I then can do a 2-way sync to/from local databases with corresponding data in the cache e.g. [URL='https://github.com/trakt/Trakt-for-Mediaportal/blob/master/TraktPlugin/TraktCache.cs#L249']TraktCache.GetCollectedMoviesFromTrakt()[/URL], this will return immediately as the data is up to date. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Trakt for MP2
Contact us
RSS
Top
Bottom