public static TorrentMovieSource CreateIncompleteTorrentMovieSource(TorrentEntry torrentEntry, TorrentImdbEntry torrentImdbEntry)
 {
     return new TorrentMovieSource
     {
         TorrentMovie = TorrentMovieFactory.CreateTorrentMovie(torrentEntry, torrentImdbEntry),
         State = TorrentMovieState.Incomplete
     };
 }
示例#2
0
 public static TorrentMovie CreateTorrentMovie(TorrentEntry torrentEntry, TorrentImdbEntry torrentImdbEntry)
 {
     return new TorrentMovie
     {
         Id = torrentImdbEntry.ImdbId,
         TorrentLink = torrentEntry.TorrentUri,
         ImdbLink = torrentImdbEntry.ImdbLink,
         Quality = torrentEntry.Quality,
         LastUpdated = DateTime.Now
     };
 }
 public void Add(TorrentImdbEntry movie)
 {
     using (var db = new LiteDatabase(PCinemaDbName))
     using (var trans = db.BeginTrans())
     {
         var c = db.GetCollection<TorrentImdbEntry>(TorrentImdbEntryCollectionName);
         if (!c.Update(movie))
         {
             c.Insert(movie);
         }
         trans.Commit();
     }
 }