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 1
MediaPortal 1 Plugins
Popular Plugins
Trakt
Use the Trakt.tv Watchlist to create a Record Schedule on TV Server?
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: 1057492" data-attributes="member: 52219"><p>@[USER=63847]huha[/USER],</p><p></p><p>I personally do not need this requirement but what you would want to do is add a reference to your project using the TraktPlugin.dll. After that add these namespaces:</p><p>[CODE]</p><p>using TraktPlugin.TraktAPI;</p><p>using TraktPlugin.TraktAPI.DataStructures;</p><p>[/CODE]</p><p></p><p>To request the users Movie watchlist you can do something like:</p><p>[CODE]</p><p>var movieWatchList = TraktAPI.GetWatchListMovies(TraktAPI.Username);</p><p></p><p>foreach (var movie in movieWatchList)</p><p>{ </p><p> ...</p><p>}</p><p>[/CODE]</p><p></p><p>Similarly you can get the users TV Show and TV Episode watchlists</p><p>[CODE]</p><p>var showWatchList = TraktAPI.GetWatchListShows(TraktAPI.Username);</p><p>var episodeWatchList = TraktAPI.GetWatchListEpisodes(TraktAPI.Username);</p><p>[/CODE]</p><p></p><p>It would be a good idea to request these from a background thread but typically it wont take long to get a response.</p><p></p><p>"TraktAPI.Username" refers to the currently logged in user, if you wanted to support more than one user account on trakt then you could call those methods with different usernames but the currently logged on user must have access to those accounts i.e. they need to be friends if the corresponding accounts are marked as private...I don't think that would be a user case that your users would be after, most likely they are only interested in their own watchlists.</p><p></p><p>Each method returns an IEnumerable<> of the respective type, it should be self explanatory from the object browser but you can get everything about the particular item such as IMDb ID, Title, Year, Overview etc. Obviously with episodes you will have access to season and episode numbers.</p><p></p><p>Another thing to keep in mind is that when a watchlist item is 'watched', trakt will automatically remove the item from your watchlist. If you want something persistent then there is a concept of 'Custom Lists' but again I don't think you can need to worry about that. For TVShow watchlists, when a user adds a show it only adds a TVShow not all underlying episodes, once a single episode is watched for a TVShow item, the tvshow item is removed from the watchlist. You may wish to persist tvshows that you process so you can record each episode in the future...not sure about how you would want to handle that.</p><p></p><p>All source is also available here: <a href="https://github.com/Technicolour/Trakt-for-Mediaportal" target="_blank">https://github.com/Technicolour/Trakt-for-Mediaportal</a></p><p></p><p>You would probably only be interested in:</p><p><a href="https://github.com/Technicolour/Trakt-for-Mediaportal/tree/master/TraktPlugin/TraktAPI" target="_blank">https://github.com/Technicolour/Trakt-for-Mediaportal/tree/master/TraktPlugin/TraktAPI</a></p></blockquote><p></p>
[QUOTE="ltfearme, post: 1057492, member: 52219"] @[USER=63847]huha[/USER], I personally do not need this requirement but what you would want to do is add a reference to your project using the TraktPlugin.dll. After that add these namespaces: [CODE] using TraktPlugin.TraktAPI; using TraktPlugin.TraktAPI.DataStructures; [/CODE] To request the users Movie watchlist you can do something like: [CODE] var movieWatchList = TraktAPI.GetWatchListMovies(TraktAPI.Username); foreach (var movie in movieWatchList) { ... } [/CODE] Similarly you can get the users TV Show and TV Episode watchlists [CODE] var showWatchList = TraktAPI.GetWatchListShows(TraktAPI.Username); var episodeWatchList = TraktAPI.GetWatchListEpisodes(TraktAPI.Username); [/CODE] It would be a good idea to request these from a background thread but typically it wont take long to get a response. "TraktAPI.Username" refers to the currently logged in user, if you wanted to support more than one user account on trakt then you could call those methods with different usernames but the currently logged on user must have access to those accounts i.e. they need to be friends if the corresponding accounts are marked as private...I don't think that would be a user case that your users would be after, most likely they are only interested in their own watchlists. Each method returns an IEnumerable<> of the respective type, it should be self explanatory from the object browser but you can get everything about the particular item such as IMDb ID, Title, Year, Overview etc. Obviously with episodes you will have access to season and episode numbers. Another thing to keep in mind is that when a watchlist item is 'watched', trakt will automatically remove the item from your watchlist. If you want something persistent then there is a concept of 'Custom Lists' but again I don't think you can need to worry about that. For TVShow watchlists, when a user adds a show it only adds a TVShow not all underlying episodes, once a single episode is watched for a TVShow item, the tvshow item is removed from the watchlist. You may wish to persist tvshows that you process so you can record each episode in the future...not sure about how you would want to handle that. All source is also available here: [url]https://github.com/Technicolour/Trakt-for-Mediaportal[/url] You would probably only be interested in: [url]https://github.com/Technicolour/Trakt-for-Mediaportal/tree/master/TraktPlugin/TraktAPI[/url] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
Trakt
Use the Trakt.tv Watchlist to create a Record Schedule on TV Server?
Contact us
RSS
Top
Bottom