Example #1
0
        private bool CallFollwitMovie(WebMovieDetailed movie, FollwitWatchStatus state)
        {
            try
            {
                // create movie
                if (movie.ExternalId.Count(x => x.Site == "IMDB") == 0)
                {
                    Log.Info("Follwit: IMDB id of movie {0} unknown, not sending", movie.Title);
                    return(false);
                }

                // and send it
                var fm = new FollwitMovie()
                {
                    Username = Configuration["username"],
                    Password = Configuration["passwordHash"],
                    IMDBId   = movie.ExternalId.First(x => x.Site == "IMDB").Id
                };

                var ret = FollwitAPI.UpdateMovieState(fm, state);
                if (ret.Response != "success")
                {
                    Log.Warn("Follwit: failed to update watch status of movie '{0}' ({1})", movie.Title, movie.Id);
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Log.Warn("Follwit: failed to update movie watch status", ex);
                return(false);
            }
            return(true);
        }
Example #2
0
        private bool CallFollwitEpisode(WebTVEpisodeDetailed episode, FollwitWatchStatus state)
        {
            try
            {
                if (episode.ExternalId.Count(x => x.Site == "TVDB") == 0)
                {
                    Log.Info("Follwit: TVDB id of episode {0} unknown, not sending", episode.Title);
                    return(false);
                }

                var fm = new FollwitEpisode()
                {
                    Username = Configuration["username"],
                    Password = Configuration["passwordHash"],
                    TVDBId   = episode.ExternalId.First(x => x.Site == "TVDB").Id
                };

                var ret = FollwitAPI.UpdateEpisodeState(fm, state);
                if (ret.Response != "success")
                {
                    Log.Warn("Follwit: failed to update watch status of episode '{0}' ({1})", episode.Title, episode.Id);
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Log.Warn("Follwit: failed to update episode watch status", ex);
                return(false);
            }
            return(true);
        }
Example #3
0
        public bool TestCredentials(string username, string password)
        {
            var data = new FollwitAccountTestData()
            {
                UserName = username,
                Password = FollwitAPI.GeneratePasswordHash(password)
            };
            var resp = FollwitAPI.TestAccount(data);

            return(resp.Response == "success");
        }
Example #4
0
 public string HashPassword(string password)
 {
     return(FollwitAPI.GeneratePasswordHash(password));
 }