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)); }
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)); } }
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)); }
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)); } }
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)); } }
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)); } }
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)); }
public BookFileDeletedEvent(BookFile bookFile, DeleteMediaFileReason reason) { BookFile = bookFile; Reason = reason; }
public MovieFileDeletedEvent(MovieFile episodeFile, DeleteMediaFileReason reason) { MovieFile = episodeFile; Reason = reason; }
public EpisodeFileDeletedEvent(EpisodeFile episodeFile, DeleteMediaFileReason reason) { EpisodeFile = episodeFile; Reason = reason; }
public TrackFileDeletedEvent(TrackFile trackFile, DeleteMediaFileReason reason) { TrackFile = trackFile; Reason = reason; }