mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-27 23:16:58 -04:00
Fixed: (HDBits) Change TVDB search for daily shows, append slash to IndexerUrl
This commit is contained in:
@@ -1,21 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.HDBits
|
||||
namespace NzbDrone.Core.Indexers.Definitions.HDBits
|
||||
{
|
||||
public class HDBits : TorrentIndexerBase<HDBitsSettings>
|
||||
{
|
||||
public override string Name => "HDBits";
|
||||
public override string[] IndexerUrls => new string[] { "https://hdbits.org" };
|
||||
public override string[] IndexerUrls => new[] { "https://hdbits.org/" };
|
||||
public override string[] LegacyUrls => new[] { "https://hdbits.org" };
|
||||
public override string Description => "Best HD Tracker";
|
||||
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
||||
public override IndexerPrivacy Privacy => IndexerPrivacy.Private;
|
||||
public override IndexerCapabilities Capabilities => SetCapabilities();
|
||||
public override bool SupportsRedirect => true;
|
||||
|
||||
public override int PageSize => 30;
|
||||
|
||||
public HDBits(IIndexerHttpClient httpClient, IEventAggregator eventAggregator, IIndexerStatusService indexerStatusService, IConfigService configService, Logger logger)
|
||||
@@ -25,7 +24,7 @@ namespace NzbDrone.Core.Indexers.HDBits
|
||||
|
||||
public override IIndexerRequestGenerator GetRequestGenerator()
|
||||
{
|
||||
return new HDBitsRequestGenerator() { Settings = Settings, Capabilities = Capabilities };
|
||||
return new HDBitsRequestGenerator { Settings = Settings, Capabilities = Capabilities };
|
||||
}
|
||||
|
||||
public override IParseIndexerResponse GetParser()
|
||||
@@ -38,13 +37,13 @@ namespace NzbDrone.Core.Indexers.HDBits
|
||||
var caps = new IndexerCapabilities
|
||||
{
|
||||
TvSearchParams = new List<TvSearchParam>
|
||||
{
|
||||
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep, TvSearchParam.TvdbId
|
||||
},
|
||||
{
|
||||
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep, TvSearchParam.TvdbId
|
||||
},
|
||||
MovieSearchParams = new List<MovieSearchParam>
|
||||
{
|
||||
MovieSearchParam.Q, MovieSearchParam.ImdbId
|
||||
}
|
||||
{
|
||||
MovieSearchParam.Q, MovieSearchParam.ImdbId
|
||||
}
|
||||
};
|
||||
|
||||
caps.Categories.AddCategoryMapping(6, NewznabStandardCategory.Audio, "Audio Track");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.HDBits
|
||||
namespace NzbDrone.Core.Indexers.Definitions.HDBits
|
||||
{
|
||||
public class TorrentQuery
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.HDBits
|
||||
namespace NzbDrone.Core.Indexers.Definitions.HDBits
|
||||
{
|
||||
public class HDBitsInfo : TorrentInfo
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Indexers.Exceptions;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.HDBits
|
||||
namespace NzbDrone.Core.Indexers.Definitions.HDBits
|
||||
{
|
||||
public class HDBitsParser : IParseIndexerResponse
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using NzbDrone.Common.Extensions;
|
||||
@@ -8,7 +9,7 @@ using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Parser;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.HDBits
|
||||
namespace NzbDrone.Core.Indexers.Definitions.HDBits
|
||||
{
|
||||
public class HDBitsRequestGenerator : IIndexerRequestGenerator
|
||||
{
|
||||
@@ -33,7 +34,7 @@ namespace NzbDrone.Core.Indexers.HDBits
|
||||
|
||||
if (imdbId != 0)
|
||||
{
|
||||
query.ImdbInfo = query.ImdbInfo ?? new ImdbInfo();
|
||||
query.ImdbInfo ??= new ImdbInfo();
|
||||
query.ImdbInfo.Id = imdbId;
|
||||
}
|
||||
|
||||
@@ -91,15 +92,23 @@ namespace NzbDrone.Core.Indexers.HDBits
|
||||
|
||||
if (tvdbId != 0)
|
||||
{
|
||||
query.TvdbInfo = query.TvdbInfo ?? new TvdbInfo();
|
||||
query.TvdbInfo ??= new TvdbInfo();
|
||||
query.TvdbInfo.Id = tvdbId;
|
||||
query.TvdbInfo.Season = searchCriteria.Season;
|
||||
query.TvdbInfo.Episode = searchCriteria.Episode;
|
||||
|
||||
if (DateTime.TryParseExact($"{searchCriteria.Season} {searchCriteria.Episode}", "yyyy MM/dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var showDate))
|
||||
{
|
||||
query.Search = showDate.ToString("yyyy-MM-dd");
|
||||
}
|
||||
else
|
||||
{
|
||||
query.TvdbInfo.Season = searchCriteria.Season;
|
||||
query.TvdbInfo.Episode = searchCriteria.Episode;
|
||||
}
|
||||
}
|
||||
|
||||
if (imdbId != 0)
|
||||
{
|
||||
query.ImdbInfo = query.ImdbInfo ?? new ImdbInfo();
|
||||
query.ImdbInfo ??= new ImdbInfo();
|
||||
query.ImdbInfo.Id = imdbId;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.Indexers.Settings;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.HDBits
|
||||
namespace NzbDrone.Core.Indexers.Definitions.HDBits
|
||||
{
|
||||
public class HDBitsSettingsValidator : NoAuthSettingsValidator<HDBitsSettings>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user