Fixed: Map Correct categories for BTN and default to back to TV

pull/26/head
Qstick 3 years ago
parent a85653b716
commit 231d43e181

@ -42,7 +42,7 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet
public override IParseIndexerResponse GetParser()
{
return new BroadcastheNetParser();
return new BroadcastheNetParser(Capabilities.Categories);
}
private IndexerCapabilities SetCapabilities()

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using NzbDrone.Common.Http;
@ -14,6 +15,13 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
private readonly IndexerCapabilitiesCategories _categories;
public BroadcastheNetParser(IndexerCapabilitiesCategories categories)
{
_categories = categories;
}
public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
{
var results = new List<ReleaseInfo>();
@ -92,7 +100,17 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet
torrentInfo.Container = torrent.Container;
torrentInfo.Codec = torrent.Codec;
torrentInfo.Resolution = torrent.Resolution;
torrentInfo.Category = new List<IndexerCategory> { NewznabStandardCategory.TV };
torrentInfo.UploadVolumeFactor = 1;
torrentInfo.DownloadVolumeFactor = 0;
torrentInfo.MinimumRatio = 1;
torrentInfo.Category = _categories.MapTrackerCatToNewznab(torrent.Resolution);
// Default to TV if category could not be mapped
if (torrentInfo.Category == null || !torrentInfo.Category.Any())
{
torrentInfo.Category = new List<IndexerCategory> { NewznabStandardCategory.TV };
}
results.Add(torrentInfo);
}

Loading…
Cancel
Save