Use the Trakt.tv Watchlist to create a Record Schedule on TV Server? (1 Viewer)

Brudertac

MP Donator
  • Premium Supporter
  • October 26, 2006
    978
    277
    Augsburg
    Home Country
    Germany Germany
    Hi!

    Is there a way to use the Trakt.tv Watchlist to create a Record Schedule on TV Server? This would be awesome. Just Watch a show in Trakt and if this shows up in EPG Data do a Record. :)
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    I haven't implemented a feature like that but I guess it should be possible if the TVServer API allows creation of scheduled recordings. If you like you can add that feature request to:

    https://github.com/Technicolour/Trakt-for-Mediaportal/issues?direction=desc&sort=created&state=open

    Maybe it would be better handled by this plugin: https://forum.team-mediaportal.com/threads/tv-server-plugin-tvwishlist.76506/

    It could get the users Watchlist from the trakt plugin API and then create scheduled recordings for movies in watchlist. @huha, would you be interested in implementing such a feature?
     

    Brudertac

    MP Donator
  • Premium Supporter
  • October 26, 2006
    978
    277
    Augsburg
    Home Country
    Germany Germany
    I use TVWishlist too and it is great. I believe it have all needs to do the Records. But is there a way to connect it to the Trakt Plugin or directly to Trakt?
    @huha is needed here :)

    Thanks!
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    The trakt plugin provides everything you can need to do such a thing, I can help hula with any questions he might have if he wants to do any integration work.
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Home Country
    Germany Germany
    ltfearme,
    could you post an example of a trakt watchlist, which you want to have recorded?
    Tvwishlist also has an API to create tvwishes from other plugins.
    Do you want to create from the watchlist a new tvwish, which will be regularly recorded? I need some help here from users who know both Trakt and TvWishlist.

    Update: So from looking through the WIKI you would need to create a Tvwish for recording and/or mark a show as watched so that it is not recorded on TV again. Is that a correct high level understanding?
     
    Last edited:

    mediacowboy

    Portal Pro
    May 5, 2012
    134
    13
    34
    Texas
    Home Country
    United States of America United States of America
    I would like that feature as well as being able to be on trakt and see a new show and have tvwishlist connect to trakt see this new show and schedule it to record. That's me and I'm not going to push for this to happen. Maybe the op can share his idea.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    @huha,

    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;

    To request the users Movie watchlist you can do something like:
    Code:
    var movieWatchList = TraktAPI.GetWatchListMovies(TraktAPI.Username);
    
    foreach (var movie in movieWatchList)
    {   
          ...
    }

    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);

    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: https://github.com/Technicolour/Trakt-for-Mediaportal

    You would probably only be interested in:
    https://github.com/Technicolour/Trakt-for-Mediaportal/tree/master/TraktPlugin/TraktAPI
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Home Country
    Germany Germany
    ltfearme,
    thanks for your posting, this was exactly what i was looking for. So I could do during EPG checking a Trakt and parse the 3 lists via API and store them as tvwishes if not done before. I will not worry about the user. However, this will not happen soon as i am currently short of time. But it´s on my list and i guess i understand the basics after your post.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    Cool huha, just give us a shout out if you want to ask any questions or use any other part of the API that you might not be familiar with.
     

    Users who are viewing this thread

    Top Bottom