Fixed: (HDBits) Unknown Categories on every release

Fixes #365
pull/422/head
Qstick 3 years ago
parent 12ae8edc50
commit 9a6391873f

@ -30,7 +30,7 @@ namespace NzbDrone.Core.Indexers.HDBits
public override IParseIndexerResponse GetParser() public override IParseIndexerResponse GetParser()
{ {
return new HDBitsParser(Settings); return new HDBitsParser(Settings, Capabilities.Categories);
} }
private IndexerCapabilities SetCapabilities() private IndexerCapabilities SetCapabilities()

@ -12,10 +12,12 @@ namespace NzbDrone.Core.Indexers.HDBits
public class HDBitsParser : IParseIndexerResponse public class HDBitsParser : IParseIndexerResponse
{ {
private readonly HDBitsSettings _settings; private readonly HDBitsSettings _settings;
private readonly IndexerCapabilitiesCategories _categories;
public HDBitsParser(HDBitsSettings settings) public HDBitsParser(HDBitsSettings settings, IndexerCapabilitiesCategories categories)
{ {
_settings = settings; _settings = settings;
_categories = categories;
} }
public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse) public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
@ -65,6 +67,7 @@ namespace NzbDrone.Core.Indexers.HDBits
Guid = string.Format("HDBits-{0}", id), Guid = string.Format("HDBits-{0}", id),
Title = result.Name, Title = result.Name,
Size = result.Size, Size = result.Size,
Categories = _categories.MapTrackerCatToNewznab(result.TypeCategory.ToString()),
InfoHash = result.Hash, InfoHash = result.Hash,
DownloadUrl = GetDownloadUrl(id), DownloadUrl = GetDownloadUrl(id),
InfoUrl = GetInfoUrl(id), InfoUrl = GetInfoUrl(id),

Loading…
Cancel
Save