Beispiel #1
0
        public async Task TestGenerateMovieFile()
        {
            MovieMagnet magnet = new MovieMagnet()
            {
                SavePath = @"E:\Media\Sister\Data\Finished\snis-842-C", HasSub = true, MovieNumber = "snis-842"
            };
            await _localFileService.GenerateMovieFile(magnet);

            Assert.Equal(MagnetStatus.Finished, magnet.IdStatus);
            _output.WriteLine(magnet.ToString());
        }
Beispiel #2
0
        public MovieMagnet Save(MovieMagnet movieMagnet)
        {
            movieMagnet.DtUpdate = DateTime.Now;

            using (var trans = new TransactionScope())
            {
                List <MovieHistory> movieHistories = AddHistory(movieMagnet);
                if (movieMagnet.IdMovieMag == 0)
                {
                    movieMagnet.IdMovieMag = (int)db.InsertEntity(movieMagnet);
                }
                else if (!db.UpdateEntity(movieMagnet))
                {
                    throw new Exception($"MovieMagnet not found in DB: {movieMagnet.ToString()}");
                }

                _movieHistoryRepo.SaveList(movieMagnet.IdMovie, movieHistories);

                trans.Complete();
            }
            return(movieMagnet);
        }