示例#1
0
        private TraktShowSync GetSyncShowsData(List<TMDbShow> shows)
        {
            var traktShows = new List<TraktShowSync.Show>();

            traktShows.AddRange(from show in shows
                                select new TraktShowSync.Show
                                 {
                                     Title = show.Title,
                                     Year = show.ReleaseDate.Substring(0,4)
                                 });

            var showSyncData = new TraktShowSync
            {
                Username = AppSettings.TraktUsername,
                Password = AppSettings.TraktPassword,
                Showlist = traktShows
            };

            return showSyncData;
        }
示例#2
0
        public static TraktResponse SyncShowLibrary(TraktShowSync syncData, TraktSyncModes mode)
        {
            // check that we have everything we need
            if (syncData == null)
                return null;

            // serialize data to JSON and send to server
            string response = TraktWeb.Transmit(string.Format(TraktURIs.SyncShowLibrary, mode.ToString()), syncData.ToJSON());

            // return success or failure
            return response.FromJSON<TraktResponse>();
        }
示例#3
0
        public static TraktShowSync GetSyncShowsData(IEnumerable<Dictionary<string, string>> shows)
        {
            var traktShows = new List<TraktShowSync.Show>();

            traktShows.AddRange(from show in shows
                                select new TraktShowSync.Show
                                {
                                    IMDbId = show[IMDbFieldMapping.cIMDbID],
                                    Title = show[IMDbFieldMapping.cTitle],
                                    Year = show[IMDbFieldMapping.cYear]
                                });

            var traktShowsData = new TraktShowSync
            {
                Username = AppSettings.TraktUsername,
                Password = AppSettings.TraktPassword,
                Showlist = traktShows
            };

            return traktShowsData;
        }
示例#4
0
        private TraktShowSync GetSyncShowsData(List<ListalExport.RSSChannel.Item> shows)
        {
            var traktShows = new List<TraktShowSync.Show>();

            traktShows.AddRange(from show in shows
                                select new TraktShowSync.Show
                                 {
                                     Title = show.Title,
                                     IMDbId = "tt" + show.IMDbId
                                 });

            var showWatchedData = new TraktShowSync
            {
                Username = AppSettings.TraktUsername,
                Password = AppSettings.TraktPassword,
                Showlist = traktShows
            };

            return showWatchedData;
        }