API Docs

» sync

Syncing trakt with media centers and mobile apps

Syncing with trakt opens up quite a few cool features. Most importantly, trakt can serve as a cloud based backup for the data in your app. This is especially useful when rebuilding a media center or installing a mobile app on your new phone. It can also be nice to sync up multiple media centers with a central trakt account. If everything is in sync, your media can be managed from trakt and be reflected in your apps. The more data trakt knows about, the better your experience will be.

Here are the common scenarios you might want to implement and the API calls needed.

Full Watched Sync

This is a 2 way sync that will get items from trakt to sync locally, plus find anything new and sync back to trakt. Perform this sync on startup or at set intervals (i.e. once every day) to keep everything in sync. This will only send data to trakt and not remove it.

Watched TV shows

  1. Call user/library/shows/watched and make sure to send min for the extended parameter. This greatly reduces the data being sent back.
  2. Loop over each show and mark it as watched on the media center.
  3. Using the same data from step 1 as a baseline, see if there is anything newly watched in the media center. If not, no action needed. If yes, call show/episode/seen for each show to tell trakt they are watched.

Watched movies

  1. Call user/library/movies/watched and make sure to send min for the extended parameter. This greatly reduces the data being sent back.
  2. Loop over each show and mark it as watched on the media center.
  3. Using the same data from step 1 as a baseline, see if there is anything newly watched in the media center. If not, no action needed. If yes, call movie/seen for each show to tell trakt they are watched.

Please read this thread in the trakt API forum for a discussion on an advanced scenario involving syncing and re-watching items.

Collection Sync

It's very handy to have a snapshot on trakt of everything you have available to watch locally. Syncing your local connection will do just that. This will only send data to trakt and not remove it.

Collected TV shows

  1. Call user/library/shows/collection and make sure to send min for the extended parameter. This greatly reduces the data being sent back.
  2. Using the data from step 1, compare this to the local collection. If nothing new, no action needed. If new episodes are found, call show/episode/library for each show to tell trakt its in the collection.

Collected movies

  1. Call user/library/movies/collection and make sure to send min for the extended parameter. This greatly reduces the data being sent back.
  2. Using the data from step 1, compare this to the local collection. If nothing new, no action needed. If new movies are found, call movie/library for each show to tell trakt its in the collection.

Clean Collection

Cleaning a collection involves comparing the trakt collection to what exists locally. This will remove items from the trakt collection if they don't exist locally anymore. You should make this clear to the user that data might be removed from trakt.

This scenario is the best way to give a true representation of what's on your media center. If you manually maintain your collection (i.e. to track your epic HD DVD collection), cleaning it is not a good idea or you risk items being removed.

Clean TV shows collection

  1. Call user/library/shows/collection and make sure to send min for the extended parameter. This greatly reduces the data being sent back.
  2. Using the data from step 1, compare this to the local collection. If you find anything on trakt that is not available locally anymore, call show/episode/unlibrary to remove it from the trakt collection.

Clean movies collection

  1. Call user/library/movies/collection and make sure to send min for the extended parameter. This greatly reduces the data being sent back.
  2. Using the data from step 1, compare this to the local collection. If you find anything on trakt that is not available locally anymore, call movie/unlibrary to remove it from the trakt collection.
loading...
Join trakt

Sign in to trakt

forgot?

Sign In
Forgot your password?
Check your email for further instructions!
We couldn't find that e-mail!

Create your new password