コード例 #1
0
 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
     };
 }
コード例 #3
0
 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();
     }
 }