mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Map Correct categories for BTN and default to back to TV
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user