コード例 #1
0
        private RemoteMovie GetRemoteMovie(PendingRelease release)
        {
            var movie = _movieService.GetMovie(release.MovieId);

            //Just in case the series was removed, but wasn't cleaned up yet (housekeeper will clean it up)
            if (movie == null)
            {
                return(null);
            }

            // var episodes = _parsingService.GetMovie(release.ParsedMovieInfo.MovieTitle);

            return(new RemoteMovie
            {
                Movie = movie,
                ParsedMovieInfo = release.ParsedMovieInfo,
                Release = release.Release
            });
        }
コード例 #2
0
        private RemoteEpisode GetRemoteEpisode(PendingRelease release)
        {
            var series = _seriesService.GetSeries(release.SeriesId);

            //Just in case the series was removed, but wasn't cleaned up yet (housekeeper will clean it up)
            if (series == null)
            {
                return(null);
            }

            var episodes = _parsingService.GetEpisodes(release.ParsedEpisodeInfo, series, true);

            return(new RemoteEpisode
            {
                Series = series,
                Episodes = episodes,
                ParsedEpisodeInfo = release.ParsedEpisodeInfo,
                Release = release.Release
            });
        }
コード例 #3
0
        private void Insert(DownloadDecision decision)
        {
            var release = new PendingRelease
            {
                MovieId         = decision.RemoteMovie.Movie.Id,
                ParsedMovieInfo = decision.RemoteMovie.ParsedMovieInfo,
                Release         = decision.RemoteMovie.Release,
                Title           = decision.RemoteMovie.Release.Title,
                Added           = DateTime.UtcNow
            };

            if (release.ParsedMovieInfo == null)
            {
                _logger.Warn("Pending release {0} does not have ParsedMovieInfo, will cause issues.", release.Title);
            }

            _repository.Insert(release);

            _eventAggregator.PublishEvent(new PendingReleasesUpdatedEvent());
        }
コード例 #4
0
 private int GetQueueId(PendingRelease pendingRelease, Episode episode)
 {
     return(HashConverter.GetHashInt31(string.Format("pending-{0}-ep{1}", pendingRelease.Id, episode.Id)));
 }
コード例 #5
0
 private void Delete(PendingRelease pendingRelease)
 {
     _repository.Delete(pendingRelease);
     _eventAggregator.PublishEvent(new PendingReleasesUpdatedEvent());
 }
コード例 #6
0
 private int GetQueueId(PendingRelease pendingRelease, Album album)
 {
     return(HashConverter.GetHashInt31(string.Format("pending-{0}-album{1}", pendingRelease.Id, album.Id)));
 }
コード例 #7
0
 private int GetQueueId(PendingRelease pendingRelease, Movie movie)
 {
     return(HashConverter.GetHashInt31(string.Format("pending-{0}-movie{1}", pendingRelease.Id, movie.Id)));
 }
コード例 #8
0
 private int GetQueueId(PendingRelease pendingRelease, Book book)
 {
     return(HashConverter.GetHashInt31(string.Format("pending-{0}-book{1}", pendingRelease.Id, book.Id)));
 }