Trakt for MP2 (2 Viewers)

ltfearme

Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,760
    7,224
    Sydney
    Home Country
    Australia Australia
    Be thankful the change won't be as big as MP1 was, it pretty much brings the whole website to the big screen so uses pretty much the entire trakt API...which is very big!
     

    aspik

    Retired Team Member
  • Team MediaPortal
  • April 14, 2008
    1,322
    586
    I could try, I don't make any promises, but I will do my best:) To me these changes don't look so easy. I viewed the commits from ltfearme regarding API v2 and it looks like the whole plugin changed... I think the best approach would be to port the currently trakt MP1 version to MP2. What do you think?
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,070
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #64
    @ltfearme when I implemented the first basic version of Trakt in MP2, I copied many source files, changed some namespaces and styles, but also did some refactorings.

    I'd like to avoid such steps for new API. I have an idea how we could reuse code in a better way: could you provide a standalone dll for the trakt API as Nuget package? This way we would save a lot of redundancies and code changes would be available to both MP1 + MP2.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,760
    7,224
    Sydney
    Home Country
    Australia Australia
    I'd like to avoid such steps for new API. I have an idea how we could reuse code in a better way: could you provide a standalone dll for the trakt API as Nuget package?
    Sounds like a sensible idea, I will look into after I've finished working on the current set of features.

    I've never created a Nuget package, presumably it's straight forward. From memory there is one thing I would need to remove from the API class and that is the ApplicationId that MP1 uses, I think everything else should be okay.

    A little note about Authentication, since this would technically be a new API v2 app it would not be able to use the same authentication method, the type of authentication that is currently used by MP1 required special permissions and is now deprecated. We would need to add support for the following workflow:

    http://docs.trakt.apiary.io/#reference/authentication-pin
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,070
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #66
    Sounds like a sensible idea, I will look into after I've finished working on the current set of features.

    I've never created a Nuget package, presumably it's straight forward. From memory there is one thing I would need to remove from the API class and that is the ApplicationId that MP1 uses, I think everything else should be okay.
    Any news on this topic? There are some user requests about the broken feature in MP2 already. I can help with nuget packaging and can also do the upload to our MP feed (I do so for TVE3/3.5 also).

    A little note about Authentication, since this would technically be a new API v2 app it would not be able to use the same authentication method, the type of authentication that is currently used by MP1 required special permissions and is now deprecated.
    Does this mean that current auth does no longer work at all? Or it does still work with "special permission"? If the latter, I think we should get this permission also for MP2.

    The linked authentication steps are quite complicated...
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,760
    7,224
    Sydney
    Home Country
    Australia Australia
    Does this mean that current auth does no longer work at all? Or it does still work with "special permission"? If the latter, I think we should get this permission also for MP2.

    The linked authentication steps are quite complicated...
    Hey @morpheus_xx, 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 (https://github.com/trakt/Trakt-for-Mediaportal/blob/master/TraktPlugin/TraktCache.cs) 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 RefreshData(), 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. TraktCache.GetCollectedMoviesFromTrakt(), this will return immediately as the data is up to date.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,070
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #68
    @ltfearme sorry, I forgot this topic a bit. Can you help to get the MP2 plugin working again with the new API? No new features, just the (few) implemented ones in MP2.

    You might guess it, I don't use trakt.tv myself. I only registered there to code and test the plugin. But I'm too busy by the overall MP2 progress so I can't take over further development of trakt for MP2.

    Of course any other @Developers or @Testers can help to bring Trakt plugin back.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,760
    7,224
    Sydney
    Home Country
    Australia Australia
    I will see what I can do @morpheus_xx , just been very busy myself lately.

    Will announce something in this thread if and when I start.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,070
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #70
    Just as a follow up here: trakt plugin of MP2 will be still missing from SR'15 Update 1 release.
     

    Users who are viewing this thread

    Top Bottom