1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 23:42:33 +01:00

Forced downloads now have episode titles.

This commit is contained in:
Mark McDowall 2012-04-22 23:47:30 -07:00
parent cef7b6a8dc
commit 06df8a86b6
2 changed files with 7 additions and 3 deletions

View File

@ -124,7 +124,7 @@ namespace NzbDrone.Core.Providers
foreach (var episode in parseResult.EpisodeNumbers) foreach (var episode in parseResult.EpisodeNumbers)
{ {
episodeString.Add(String.Format("{0}x{1}", parseResult.SeasonNumber, episode)); episodeString.Add(String.Format("{0}x{1:00}", parseResult.SeasonNumber, episode));
} }
var epNumberString = String.Join("-", episodeString); var epNumberString = String.Join("-", episodeString);

View File

@ -15,15 +15,18 @@ namespace NzbDrone.Core.Providers
private readonly IDatabase _database; private readonly IDatabase _database;
private readonly SeriesProvider _seriesProvider; private readonly SeriesProvider _seriesProvider;
private readonly DownloadProvider _downloadProvider; private readonly DownloadProvider _downloadProvider;
private readonly EpisodeProvider _episodeProvider;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject] [Inject]
public SearchResultProvider(IDatabase database, SeriesProvider seriesProvider, public SearchResultProvider(IDatabase database, SeriesProvider seriesProvider,
DownloadProvider downloadProvider) DownloadProvider downloadProvider, EpisodeProvider episodeProvider)
{ {
_database = database; _database = database;
_seriesProvider = seriesProvider; _seriesProvider = seriesProvider;
_downloadProvider = downloadProvider; _downloadProvider = downloadProvider;
_episodeProvider = episodeProvider;
} }
public SearchResultProvider() public SearchResultProvider()
@ -101,11 +104,12 @@ namespace NzbDrone.Core.Providers
var item = _database.Single<SearchResultItem>(itemId); var item = _database.Single<SearchResultItem>(itemId);
var searchResult = _database.Single<SearchResult>(item.SearchResultId); var searchResult = _database.Single<SearchResult>(item.SearchResultId);
var series = _seriesProvider.GetSeries(searchResult.SeriesId); var series = _seriesProvider.GetSeries(searchResult.SeriesId);
var parseResult = Parser.ParseTitle(item.ReportTitle); var parseResult = Parser.ParseTitle(item.ReportTitle);
parseResult.NzbUrl = item.NzbUrl; parseResult.NzbUrl = item.NzbUrl;
parseResult.Series = series; parseResult.Series = series;
parseResult.Indexer = item.Indexer; parseResult.Indexer = item.Indexer;
var episodes = _episodeProvider.GetEpisodesByParseResult(parseResult);
_downloadProvider.DownloadReport(parseResult); _downloadProvider.DownloadReport(parseResult);
} }