public static TorrentMovieSource CreateCompleteTorrentMovieSource(TorrentMovie movie, ImdbData imdbData, SubtitleData[] subtitles)
 {
     return new TorrentMovieSource
     {
         TorrentMovie = TorrentMovieFactory.CreateTorrentMovie(movie, imdbData, subtitles),
         State = TorrentMovieState.Complete
     };
 }
예제 #2
0
        public void Add(ImdbData movie)
        {
            movie.LastUpdated = DateTime.Now;

            using (var db = new LiteDatabase(PCinemaDbName))
            using (var trans = db.BeginTrans())
            {
                var c = db.GetCollection<ImdbData>(ImdbMovieCollectionName);
                if (!c.Update(movie))
                {
                    c.Insert(movie);
                }
                trans.Commit();
            }
        }
예제 #3
0
 public static TorrentMovie CreateTorrentMovie(TorrentMovie movie, ImdbData imdbData, SubtitleData[] subtitles)
 {
     return new TorrentMovie
     {
         Id = movie.Id,
         TorrentLink = movie.TorrentLink,
         ImdbLink = movie.ImdbLink,
         PictureUrl = imdbData.PictureLink,
         Movie = (imdbData.MovieName ?? movie.Movie).Trim(),
         Rating = imdbData.Rating.GetValueOrDefault(),
         Quality = movie.Quality,
         Subtitles = subtitles,
         LastUpdated = DateTime.Now
     };
 }