Exemplo n.º 1
0
        public OperationResult<TvEpisode> AddTvEpisode(TvEpisode episode)
        {
            if (_tvEpisodeRepository.FindBy(m => m.FileHash == episode.FileHash && m.Episode == episode.Episode && m.Season == episode.Season).Any())
            {
                return new OperationResult<TvEpisode>(false);
            }

            episode.Key = Guid.NewGuid();
            _tvEpisodeRepository.Add(episode);
            _tvEpisodeRepository.Save();

            return new OperationResult<TvEpisode>(true) { Entity = episode };
        }
Exemplo n.º 2
0
        public TvEpisode UpdateTvEpisode(TvEpisode episode)
        {
            _tvEpisodeRepository.Edit(episode);
            _tvEpisodeRepository.Save();

            return episode;
        }