コード例 #1
0
        public static TraktSyncResponse RemoveSeasonFromWatchlist(TraktSyncSeasonEx show)
        {
            var shows = new TraktSyncSeasonsEx
            {
                Shows = new List<TraktSyncSeasonEx>() { show }
            };

            return RemoveSeasonsFromWatchlist(shows);
        }
コード例 #2
0
        public static TraktSyncResponse AddSeasonToWatchlist(TraktSyncSeasonEx show)
        {
            var shows = new TraktSyncSeasonsEx
            {
                Shows = new List<TraktSyncSeasonEx>() { show }
            };

            return AddSeasonsToWatchlist(shows);
        }
コード例 #3
0
        public static void AddSeasonToWatchList(string title, int? year, int season, int? tvdbid, string imdbid, int? tmdbid, int? traktid)
        {
            if (!GUICommon.CheckLogin(false)) return;

            var seasonSync = new TraktSyncSeasonEx
            {
                Ids = new TraktShowId
                {
                    Trakt = traktid,
                    Imdb = imdbid,
                    Tmdb = tmdbid,
                    Tvdb = tvdbid
                },
                Title = title,
                Year = year,
                Seasons = new List<TraktSyncSeasonEx.Season>
                {
                    new TraktSyncSeasonEx.Season
                    {
                        Number = season
                    }
                }
            };

            var syncThread = new Thread((objSyncData) =>
            {
                var response = TraktAPI.TraktAPI.AddSeasonToWatchlist(objSyncData as TraktSyncSeasonEx);
            })
            {
                IsBackground = true,
                Name = "Watchlist"
            };

            syncThread.Start(seasonSync);

            TraktCache.AddSeasonToWatchlist(
                new TraktShow
                {
                    Ids = seasonSync.Ids,
                    Title = seasonSync.Title,
                    Year = seasonSync.Year
                },
                new TraktSeason
                {
                    Number = season
                }
             );
        }