public static TorrentMovieSource CreateCompleteTorrentMovieSource(TorrentMovie movie, ImdbData imdbData, SubtitleData[] subtitles) { return new TorrentMovieSource { TorrentMovie = TorrentMovieFactory.CreateTorrentMovie(movie, imdbData, subtitles), State = TorrentMovieState.Complete }; }
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(); } }
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 }; }