Trakt for MP2 (1 Viewer)

Alberto83

Portal Pro
August 7, 2012
336
108
Home Country
Italy Italy
I'll sync my mediaportal full account with a trakt test account and see the result.
When I tried the plugin I used a clean account in both sides, so what's probably why I worked correctly.
 

aspik

Retired Team Member
  • Team MediaPortal
  • April 14, 2008
    1,322
    586
    The two authorization errors are because your entered a wrong pincode. The third attempt was a success, is this correct?

    Regarding sync issues. You have 303 movies in the media library:
    Code:
    [2018-07-06 18:13:57,716] [177259 ] [Thread10 ] [INFO ] - Trakt: found 303 collected movies available to sync in media library
    and adding those movies to trakt collection was a success, but the response from trakt says that only 2 movies were added:
    Code:
    [2018-07-06 18:14:00,665] [180208 ] [Thread10 ] [INFO ] - Trakt: trying to add 303 collected movies to trakt collection
    [2018-07-06 18:14:17,037] [196580 ] [Thread10 ] [INFO ] - Trakt: successfully added 2 collected movies to trakt collection
    means that the post to trakt should contain only the 2 movies and not the entire local collection. This looks like a bug in the plugin.

    You have 219 watched movies in the ML:
    Code:
    [2018-07-06 18:13:57,717] [177260 ] [Thread10 ] [INFO ] - Trakt: found 219 watched movies available to sync in media library
    and all of them were successfully added to trakt watched history:
    Code:
    [2018-07-06 18:13:57,723] [177266 ] [Thread10 ] [INFO ] - Trakt: trying to add 219 watched movies to trakt watched history
    [2018-07-06 18:14:00,658] [180201 ] [Thread10 ] [INFO ] - Trakt: successfully added 219 watched movies to trakt watched history
    If those watched movies were already at trakt, then this post should not happen. Nevertheless, even if they are synced again, the watched date should not be the sync date, but the last played date from MP2.

    During the series sync a trakt responses with an 504 Gateway time-out. Here I can't do anything, other then recommend whats the error message says: "Please try again in a few minutes."

    I did a test today and all my watched/collected movies were added to trakt with the correct watched/collected dates.
    I'll look into the two post issues. Did you had the chance to test it again with a smaller set of movies/series and your test account?
     

    Alberto83

    Portal Pro
    August 7, 2012
    336
    108
    Home Country
    Italy Italy
    I'm trying today with a test account to see what's happening.
    It took me 2 days to remove all the synced bad history, and I can confirm all movies synced correctly. None of TV serie did and they where all added as watched by the time of sync. I don't know if something happened during sync that screwed the TV serie sync, maybe. It's like it didn't recognize the watch date.

    Ps: yes I had problems with pins at first. I coped past them twice, but they had a space at the end and it obviously didn't work.

    Sent from my SM-N950F using Tapatalk
     

    Alberto83

    Portal Pro
    August 7, 2012
    336
    108
    Home Country
    Italy Italy
    @aspik I'm checking the logs again and during tv serie sync you can see it's trying to sync a lot of tv series on 2018-03-18 (and movies too. It synced like 50 movies that day). This is not possible, I haven't watched so many things that day, surely not episodes of Eureka, for example.. I have a bad feeling that my watch database is corrupted. Maybe I should delete and recreate my profile on mediaportal and force a sync with trakt?
     

    aspik

    Retired Team Member
  • Team MediaPortal
  • April 14, 2008
    1,322
    586
    @Alberto83
    Hold on a bit with the manual testing. I'm preparing something more automatic. I've added a new backup library button. After hitting it, two new json files will be created in your trakt MP2 profile directory. One contains your MP2 media library movies and the second one your series. This button works independently from trakt (no need to authorize trakt). Those files contains only the needed data for a trakt sync (imdb, year, date added to db, etc).

    Next, I wrote a test (this time an integration test :p) in where I exchange the mocked trakt client with a real one and instead of some test data I set the real data from the previously saved json file. Then I'm calling the sync with trakt method and voila all my movies are send to trakt with just one click from within VS :) By adding few asserts I can verify if the sync was OK or not.

    The trak lib provides also some other usefully methods, like RemoveWatchedHistoryItems. So, to remove some (or all) watched movies will be also easy.
     

    Attachments

    • backup_lib.png
      backup_lib.png
      735.6 KB

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,554
    3,936
    Lehmden
    Home Country
    Germany Germany
    Hi.
    Is it possible to restore the library from those json files too? Asking because of a possibility to transfer e.g. watched flags from one installation to another in a fast (offline) way.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,708
    3,491
    Stuttgart
    Home Country
    Germany Germany
    Hi.
    Is it possible to restore the library from those json files too? Asking because of a possibility to transfer e.g. watched flags from one installation to another in a fast (offline) way.
    I had exactly the same thought in the morning, but Lehmden was faster.
     

    Alberto83

    Portal Pro
    August 7, 2012
    336
    108
    Home Country
    Italy Italy
    @Alberto83
    Hold on a bit with the manual testing. I'm preparing something more automatic. I've added a new backup library button. After hitting it, two new json files will be created in your trakt MP2 profile directory. One contains your MP2 media library movies and the second one your series. This button works independently from trakt (no need to authorize trakt). Those files contains only the needed data for a trakt sync (imdb, year, date added to db, etc).

    Next, I wrote a test (this time an integration test :p) in where I exchange the mocked trakt client with a real one and instead of some test data I set the real data from the previously saved json file. Then I'm calling the sync with trakt method and voila all my movies are send to trakt with just one click from within VS :) By adding few asserts I can verify if the sync was OK or not.

    The trak lib provides also some other usefully methods, like RemoveWatchedHistoryItems. So, to remove some (or all) watched movies will be also easy.

    Looking forward to try this!!! :p
     

    aspik

    Retired Team Member
  • Team MediaPortal
  • April 14, 2008
    1,322
    586
    Is it possible to restore the library from those json files too?
    I expected this kind of question ;) The main purpose of this button is just to make the testing easier. I don't think it will stay in the final release of the trakt plugin. It doesn't fit here.

    But I agree, we need a convenient way to somehow transfer watched flags in case of clean install. And as long as it affect only the watched flags, this new backup functionality can be used as a base for it. The restore function still needs to be "extracted" from the plugin and adjusted to what it should do in case of restoring the watched flags without trakt.

    What do you think about the following:
    - move the backup function to an own small plugin, which is compatible only with MP 2.1.3.
    - add a restore/backup function either directly to 2.2 or also as a small plugin which is compatible only with 2.2
    - write a description in the release notes of 2.2 what needs to be done to transfer the watched flags from 2.1.3 to 2.2.

    Anyway, I still want first to fix those sync issues, only then I can try to do the above.
     

    Users who are viewing this thread

    Top Bottom