mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-02-10 08:52:32 +01:00
Fixed: Map Correct categories for BTN and default to back to TV
This commit is contained in:
parent
a85653b716
commit
231d43e181
2 changed files with 20 additions and 2 deletions
|
|
@ -42,7 +42,7 @@ public override IIndexerRequestGenerator GetRequestGenerator()
|
|||
|
||||
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 @@ public class BroadcastheNetParser : IParseIndexerResponse
|
|||
|
||||
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 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
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…
Reference in a new issue