public static TorrentMovieSource CreateCompleteTorrentMovieSource(TorrentMovie movie)
 {
     return new TorrentMovieSource
     {
         TorrentMovie = movie,
         State = TorrentMovieState.Complete
     };
 }
 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(Uri uri, TorrentMovie movie)
 {
     using (var db = new LiteDatabase(PCinemaDbName))
     using (var trans = db.BeginTrans())
     {
         var c = db.GetCollection<TorrentMovie>(TorrentMovieCollectionName);
         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
     };
 }
 public void Add(Uri uri, TorrentMovie movie)
 {
     _imdbCache.TryAdd(uri.AbsoluteUri, movie);
     _repository.Add(uri, movie);
 }