Esempio n. 1
0
        public void Delete(MovieFile movieFile, DeleteMediaFileReason reason)
        {
            //Little hack so we have the movie attached for the event consumers
            movieFile.Movie.LazyLoad();
            movieFile.Path = Path.Combine(movieFile.Movie.Value.Path, movieFile.RelativePath);

            _mediaFileRepository.Delete(movieFile);
            _eventAggregator.PublishEvent(new MovieFileDeletedEvent(movieFile, reason));
        }
Esempio n. 2
0
 public void Delete(TrackFile trackFile, DeleteMediaFileReason reason)
 {
     _mediaFileRepository.Delete(trackFile);
     // If the trackfile wasn't mapped to a track, don't publish an event
     if (trackFile.AlbumId > 0)
     {
         _eventAggregator.PublishEvent(new TrackFileDeletedEvent(trackFile, reason));
     }
 }
Esempio n. 3
0
        public void Delete(EpisodeFile episodeFile, DeleteMediaFileReason reason)
        {
            //Little hack so we have the episodes and series attached for the event consumers
            episodeFile.Episodes.LazyLoad();
            episodeFile.Path = Path.Combine(episodeFile.Series.Value.Path, episodeFile.RelativePath);

            _mediaFileRepository.Delete(episodeFile);
            _eventAggregator.PublishEvent(new EpisodeFileDeletedEvent(episodeFile, reason));
        }
Esempio n. 4
0
        public void DeleteMany(List <BookFile> bookFiles, DeleteMediaFileReason reason)
        {
            _mediaFileRepository.DeleteMany(bookFiles);

            // publish events where trackfile was mapped to a track
            foreach (var bookFile in bookFiles.Where(x => x.EditionId > 0))
            {
                _eventAggregator.PublishEvent(new BookFileDeletedEvent(bookFile, reason));
            }
        }
Esempio n. 5
0
        public void Delete(BookFile bookFile, DeleteMediaFileReason reason)
        {
            _mediaFileRepository.Delete(bookFile);

            // If the trackfile wasn't mapped to a track, don't publish an event
            if (bookFile.EditionId > 0)
            {
                _eventAggregator.PublishEvent(new BookFileDeletedEvent(bookFile, reason));
            }
        }
Esempio n. 6
0
        public void DeleteMany(List <TrackFile> trackFiles, DeleteMediaFileReason reason)
        {
            _mediaFileRepository.DeleteMany(trackFiles);

            // publish events where trackfile was mapped to a track
            foreach (var trackFile in trackFiles.Where(x => x.AlbumId > 0))
            {
                _eventAggregator.PublishEvent(new TrackFileDeletedEvent(trackFile, reason));
            }
        }
Esempio n. 7
0
        public void Delete(MovieFile movieFile, DeleteMediaFileReason reason)
        {
            //Little hack so we have the movie attached for the event consumers
            if (movieFile.Movie == null)
            {
                movieFile.Movie = _movieRepository.Get(movieFile.MovieId);
            }

            movieFile.Path = Path.Combine(movieFile.Movie.Path, movieFile.RelativePath);

            _mediaFileRepository.Delete(movieFile);
            _eventAggregator.PublishEvent(new MovieFileDeletedEvent(movieFile, reason));
        }
Esempio n. 8
0
 public BookFileDeletedEvent(BookFile bookFile, DeleteMediaFileReason reason)
 {
     BookFile = bookFile;
     Reason   = reason;
 }
Esempio n. 9
0
 public MovieFileDeletedEvent(MovieFile episodeFile, DeleteMediaFileReason reason)
 {
     MovieFile = episodeFile;
     Reason    = reason;
 }
Esempio n. 10
0
 public EpisodeFileDeletedEvent(EpisodeFile episodeFile, DeleteMediaFileReason reason)
 {
     EpisodeFile = episodeFile;
     Reason = reason;
 }
Esempio n. 11
0
 public TrackFileDeletedEvent(TrackFile trackFile, DeleteMediaFileReason reason)
 {
     TrackFile = trackFile;
     Reason    = reason;
 }
Esempio n. 12
0
 public EpisodeFileDeletedEvent(EpisodeFile episodeFile, DeleteMediaFileReason reason)
 {
     EpisodeFile = episodeFile;
     Reason      = reason;
 }