Beispiel #1
0
 public bool CancelWatchingMovie(WebMovieDetailed movie)
 {
     TraktResponse response = TraktAPI.ScrobbleMovie(null, TraktScrobbleState.cancelwatching);
     if (response.Status != "success")
     {
         Log.Warn("Trakt: failed to cancel watching movie: {0}", response.Error);
         return false;
     }
     else
     {
         return true;
     }
 }
 public bool StartWatchingMovie(WebMovieDetailed movie)
 {
     Log.Debug("WSD: Start watching movie {0}", movie.Title);
     return true;
 }
 public bool FinishMovie(WebMovieDetailed movie)
 {
     Log.Debug("WSD: Finished movie {0}", movie.Title);
     return true;
 }
 public bool CancelWatchingMovie(WebMovieDetailed movie)
 {
     Log.Debug("WSD: Canceled movie {0}", movie.Title);
     return true;
 }
 public bool WatchingMovie(WebMovieDetailed movie, int progress)
 {
     Log.Debug("WSD: Watching movie {0} ({1}%)", movie.Title, progress);
     return true;
 }
 public bool StartWatchingMovie(WebMovieDetailed movie)
 {
     return CallFollwitMovie(movie, FollwitWatchStatus.Watching);
 }
Beispiel #7
0
 public MovieViewModel(WebMovieDetailed movie)
 {
     Movie = movie;
 }
 public bool FinishMovie(WebMovieDetailed movie)
 {
     return CallMovieAPI(movie, TraktWatchStatus.Scrobble, 100);
 }
 public bool WatchingMovie(WebMovieDetailed movie, int progress)
 {
     // Follw.it doesn't require to send a status each X minutes or something
     return true;
 }
Beispiel #10
0
 public bool WatchingMovie(WebMovieDetailed movie, int progress)
 {
     return CallMovieAPI(movie, TraktScrobbleState.watching, progress);
 }
Beispiel #11
0
 public bool StartWatchingMovie(WebMovieDetailed movie)
 {
     return true;
 }
Beispiel #12
0
 public bool FinishMovie(WebMovieDetailed movie)
 {
     return CallMovieAPI(movie, TraktScrobbleState.scrobble, 100);
 }
Beispiel #13
0
        public WebMovieDetailed GetFullVideo(int videoId)
        {
            string sql = "Select movie.idMovie, local.strFilename, path.strPath, movie.discid, movie.hasSubtitles, " +
                        "info.strTitle, info.strCast, " +
                        "info.iYear, info.strGenre, info.mpaa, info.strPlotOutline, info.strPlot, info.fRating, info.strVotes, info.runtime, info.IMDBID " +
                        "from movie as movie, movieinfo as info, files as local, path as path where movie.idMovie = info.idMovie and movie.idPath = local.idPath " +
                        "and path.idPath = local.idPath and movie.idMovie = " + videoId;
            return ReadRow<WebMovieDetailed>(sql, delegate(SQLiteDataReader reader)
            {
                try
                {
                    int id = DatabaseHelperMethods.SafeInt32(reader, 0);
                    string title = DatabaseHelperMethods.SafeStr(reader, 5);
                    WebMovieDetailed movie = new WebMovieDetailed()
                    {
                        Id = id,
                        Title = title,
                        Actors = DatabaseHelperMethods.SafeStr(reader, 6),
                        Year = DatabaseHelperMethods.SafeInt32(reader, 7),
                        Genre = DatabaseHelperMethods.SafeStr(reader, 8),
                        Certification = DatabaseHelperMethods.SafeStr(reader, 9),
                        TagLine = DatabaseHelperMethods.SafeStr(reader, 10),
                        Summary = DatabaseHelperMethods.SafeStr(reader, 11),
                        Score = Double.Parse(DatabaseHelperMethods.SafeStr(reader, 12)),
                        Popularity = Int32.Parse(DatabaseHelperMethods.SafeStr(reader, 13)),
                        Runtime = DatabaseHelperMethods.SafeInt32(reader, 14),
                        ImdbId = DatabaseHelperMethods.SafeStr(reader, 15),
                        CoverThumbPath = GetCoverArtName(Path.Combine(Utils.GetBannerPath("videos"), "Title"), title + "{" + id + "}"),
                        CoverPath = GetLargeCoverArtName(Path.Combine(Utils.GetBannerPath("videos"), "Title"), title + "{" + id + "}")
                    };

                    movie.Files.Add(new WebMovieFile()
                    {
                        Filename = DatabaseHelperMethods.SafeStr(reader, 1) + DatabaseHelperMethods.SafeStr(reader, 2),
                        DiscId = DatabaseHelperMethods.SafeStr(reader, 3),
                        HasSubtitles = DatabaseHelperMethods.SafeBoolean(reader, 4),
                    });

                    return movie;
                }
                catch (Exception ex)
                {
                    Log.Error("Error reading video details", ex);
                    return null;
                }
            });
        }
 public bool WatchingMovie(WebMovieDetailed movie, int progress)
 {
     return CallMovieAPI(movie, TraktWatchStatus.Watching, progress);
 }
        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;
        }
 public bool CancelWatchingMovie(WebMovieDetailed movie)
 {
     return CallMovieAPI(movie, TraktWatchStatus.CancelWatching, null);
 }
 public bool FinishMovie(WebMovieDetailed movie)
 {
     return CallFollwitMovie(movie, FollwitWatchStatus.Watched);
 }
 public bool StartWatchingMovie(WebMovieDetailed movie)
 {
     return CallMovieAPI(movie, TraktWatchStatus.Watching, 0);
 }
Beispiel #19
0
 public MovieViewModel(WebMovieDetailed movie)
 {
     Movie = movie;
     Id = Movie.Id;
 }