mirror of
https://github.com/fergalmoran/Readarr.git
synced 2025-12-22 09:29:59 +00:00
New: Link indexer to specific download client
Co-authored-by: Qstick <qstick@gmail.com> (cherry picked from commit 13aaa20f1bf1448fa804738804205cb16f0d91f9) Closes #1485
This commit is contained in:
@@ -0,0 +1,100 @@
|
|||||||
|
import _ from 'lodash';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { createSelector } from 'reselect';
|
||||||
|
import { fetchDownloadClients } from 'Store/Actions/settingsActions';
|
||||||
|
import sortByName from 'Utilities/Array/sortByName';
|
||||||
|
import EnhancedSelectInput from './EnhancedSelectInput';
|
||||||
|
|
||||||
|
function createMapStateToProps() {
|
||||||
|
return createSelector(
|
||||||
|
(state) => state.settings.downloadClients,
|
||||||
|
(state, { includeAny }) => includeAny,
|
||||||
|
(state, { protocol }) => protocol,
|
||||||
|
(downloadClients, includeAny, protocolFilter) => {
|
||||||
|
const {
|
||||||
|
isFetching,
|
||||||
|
isPopulated,
|
||||||
|
error,
|
||||||
|
items
|
||||||
|
} = downloadClients;
|
||||||
|
|
||||||
|
const filteredItems = items.filter((item) => item.protocol === protocolFilter);
|
||||||
|
|
||||||
|
const values = _.map(filteredItems.sort(sortByName), (downloadClient) => {
|
||||||
|
return {
|
||||||
|
key: downloadClient.id,
|
||||||
|
value: downloadClient.name
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
if (includeAny) {
|
||||||
|
values.unshift({
|
||||||
|
key: 0,
|
||||||
|
value: '(Any)'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
isFetching,
|
||||||
|
isPopulated,
|
||||||
|
error,
|
||||||
|
values
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapDispatchToProps = {
|
||||||
|
dispatchFetchDownloadClients: fetchDownloadClients
|
||||||
|
};
|
||||||
|
|
||||||
|
class DownloadClientSelectInputConnector extends Component {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lifecycle
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
if (!this.props.isPopulated) {
|
||||||
|
this.props.dispatchFetchDownloadClients();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Listeners
|
||||||
|
|
||||||
|
onChange = ({ name, value }) => {
|
||||||
|
this.props.onChange({ name, value: parseInt(value) });
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// Render
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<EnhancedSelectInput
|
||||||
|
{...this.props}
|
||||||
|
onChange={this.onChange}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DownloadClientSelectInputConnector.propTypes = {
|
||||||
|
isFetching: PropTypes.bool.isRequired,
|
||||||
|
isPopulated: PropTypes.bool.isRequired,
|
||||||
|
name: PropTypes.string.isRequired,
|
||||||
|
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
||||||
|
values: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
|
includeAny: PropTypes.bool.isRequired,
|
||||||
|
onChange: PropTypes.func.isRequired,
|
||||||
|
dispatchFetchDownloadClients: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
DownloadClientSelectInputConnector.defaultProps = {
|
||||||
|
includeAny: false,
|
||||||
|
protocol: 'torrent'
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(createMapStateToProps, mapDispatchToProps)(DownloadClientSelectInputConnector);
|
||||||
@@ -10,6 +10,7 @@ import BookshelfInputConnector from './BookshelfInputConnector';
|
|||||||
import CaptchaInputConnector from './CaptchaInputConnector';
|
import CaptchaInputConnector from './CaptchaInputConnector';
|
||||||
import CheckInput from './CheckInput';
|
import CheckInput from './CheckInput';
|
||||||
import DeviceInputConnector from './DeviceInputConnector';
|
import DeviceInputConnector from './DeviceInputConnector';
|
||||||
|
import DownloadClientSelectInputConnector from './DownloadClientSelectInputConnector';
|
||||||
import EnhancedSelectInput from './EnhancedSelectInput';
|
import EnhancedSelectInput from './EnhancedSelectInput';
|
||||||
import EnhancedSelectInputConnector from './EnhancedSelectInputConnector';
|
import EnhancedSelectInputConnector from './EnhancedSelectInputConnector';
|
||||||
import FormInputHelpText from './FormInputHelpText';
|
import FormInputHelpText from './FormInputHelpText';
|
||||||
@@ -81,6 +82,9 @@ function getComponent(type) {
|
|||||||
case inputTypes.INDEXER_SELECT:
|
case inputTypes.INDEXER_SELECT:
|
||||||
return IndexerSelectInputConnector;
|
return IndexerSelectInputConnector;
|
||||||
|
|
||||||
|
case inputTypes.DOWNLOAD_CLIENT_SELECT:
|
||||||
|
return DownloadClientSelectInputConnector;
|
||||||
|
|
||||||
case inputTypes.ROOT_FOLDER_SELECT:
|
case inputTypes.ROOT_FOLDER_SELECT:
|
||||||
return RootFolderSelectInputConnector;
|
return RootFolderSelectInputConnector;
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export const QUALITY_PROFILE_SELECT = 'qualityProfileSelect';
|
|||||||
export const METADATA_PROFILE_SELECT = 'metadataProfileSelect';
|
export const METADATA_PROFILE_SELECT = 'metadataProfileSelect';
|
||||||
export const BOOK_EDITION_SELECT = 'bookEditionSelect';
|
export const BOOK_EDITION_SELECT = 'bookEditionSelect';
|
||||||
export const INDEXER_SELECT = 'indexerSelect';
|
export const INDEXER_SELECT = 'indexerSelect';
|
||||||
|
export const DOWNLOAD_CLIENT_SELECT = 'downloadClientSelect';
|
||||||
export const ROOT_FOLDER_SELECT = 'rootFolderSelect';
|
export const ROOT_FOLDER_SELECT = 'rootFolderSelect';
|
||||||
export const SELECT = 'select';
|
export const SELECT = 'select';
|
||||||
export const DYNAMIC_SELECT = 'dynamicSelect';
|
export const DYNAMIC_SELECT = 'dynamicSelect';
|
||||||
@@ -40,6 +41,7 @@ export const all = [
|
|||||||
METADATA_PROFILE_SELECT,
|
METADATA_PROFILE_SELECT,
|
||||||
BOOK_EDITION_SELECT,
|
BOOK_EDITION_SELECT,
|
||||||
INDEXER_SELECT,
|
INDEXER_SELECT,
|
||||||
|
DOWNLOAD_CLIENT_SELECT,
|
||||||
ROOT_FOLDER_SELECT,
|
ROOT_FOLDER_SELECT,
|
||||||
SELECT,
|
SELECT,
|
||||||
DYNAMIC_SELECT,
|
DYNAMIC_SELECT,
|
||||||
|
|||||||
@@ -45,7 +45,9 @@ function EditIndexerModalContent(props) {
|
|||||||
supportsSearch,
|
supportsSearch,
|
||||||
tags,
|
tags,
|
||||||
fields,
|
fields,
|
||||||
priority
|
priority,
|
||||||
|
protocol,
|
||||||
|
downloadClientId
|
||||||
} = item;
|
} = item;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -165,6 +167,23 @@ function EditIndexerModalContent(props) {
|
|||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
|
<FormGroup
|
||||||
|
advancedSettings={advancedSettings}
|
||||||
|
isAdvanced={true}
|
||||||
|
>
|
||||||
|
<FormLabel>{translate('DownloadClient')}</FormLabel>
|
||||||
|
|
||||||
|
<FormInputGroup
|
||||||
|
type={inputTypes.DOWNLOAD_CLIENT_SELECT}
|
||||||
|
name="downloadClientId"
|
||||||
|
helpText={translate('IndexerDownloadClientHelpText')}
|
||||||
|
{...downloadClientId}
|
||||||
|
includeAny={true}
|
||||||
|
protocol={protocol.value}
|
||||||
|
onChange={onInputChange}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<FormLabel>
|
<FormLabel>
|
||||||
{translate('Tags')}
|
{translate('Tags')}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using FluentAssertions;
|
|||||||
using Moq;
|
using Moq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using NzbDrone.Core.Download;
|
using NzbDrone.Core.Download;
|
||||||
|
using NzbDrone.Core.Download.Clients;
|
||||||
using NzbDrone.Core.Indexers;
|
using NzbDrone.Core.Indexers;
|
||||||
using NzbDrone.Core.Test.Framework;
|
using NzbDrone.Core.Test.Framework;
|
||||||
|
|
||||||
@@ -67,6 +68,17 @@ namespace NzbDrone.Core.Test.Download
|
|||||||
return mock;
|
return mock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void WithTorrentIndexer(int downloadClientId)
|
||||||
|
{
|
||||||
|
Mocker.GetMock<IIndexerFactory>()
|
||||||
|
.Setup(v => v.Find(It.IsAny<int>()))
|
||||||
|
.Returns(Builder<IndexerDefinition>
|
||||||
|
.CreateNew()
|
||||||
|
.With(v => v.Id = _nextId++)
|
||||||
|
.With(v => v.DownloadClientId = downloadClientId)
|
||||||
|
.Build());
|
||||||
|
}
|
||||||
|
|
||||||
private void GivenBlockedClient(int id)
|
private void GivenBlockedClient(int id)
|
||||||
{
|
{
|
||||||
_blockedProviders.Add(new DownloadClientStatus
|
_blockedProviders.Add(new DownloadClientStatus
|
||||||
@@ -223,5 +235,39 @@ namespace NzbDrone.Core.Test.Download
|
|||||||
client3.Definition.Id.Should().Be(2);
|
client3.Definition.Id.Should().Be(2);
|
||||||
client4.Definition.Id.Should().Be(3);
|
client4.Definition.Id.Should().Be(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void should_always_choose_indexer_client()
|
||||||
|
{
|
||||||
|
WithUsenetClient();
|
||||||
|
WithTorrentClient();
|
||||||
|
WithTorrentClient();
|
||||||
|
WithTorrentClient();
|
||||||
|
WithTorrentIndexer(3);
|
||||||
|
|
||||||
|
var client1 = Subject.GetDownloadClient(DownloadProtocol.Torrent, 1);
|
||||||
|
var client2 = Subject.GetDownloadClient(DownloadProtocol.Torrent, 1);
|
||||||
|
var client3 = Subject.GetDownloadClient(DownloadProtocol.Torrent, 1);
|
||||||
|
var client4 = Subject.GetDownloadClient(DownloadProtocol.Torrent, 1);
|
||||||
|
var client5 = Subject.GetDownloadClient(DownloadProtocol.Torrent, 1);
|
||||||
|
|
||||||
|
client1.Definition.Id.Should().Be(3);
|
||||||
|
client2.Definition.Id.Should().Be(3);
|
||||||
|
client3.Definition.Id.Should().Be(3);
|
||||||
|
client4.Definition.Id.Should().Be(3);
|
||||||
|
client5.Definition.Id.Should().Be(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void should_fail_to_choose_client_when_indexer_reference_does_not_exist()
|
||||||
|
{
|
||||||
|
WithUsenetClient();
|
||||||
|
WithTorrentClient();
|
||||||
|
WithTorrentClient();
|
||||||
|
WithTorrentClient();
|
||||||
|
WithTorrentIndexer(5);
|
||||||
|
|
||||||
|
Assert.Throws<DownloadClientUnavailableException>(() => Subject.GetDownloadClient(DownloadProtocol.Torrent, 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ namespace NzbDrone.Core.Test.Download
|
|||||||
.Returns(_downloadClients);
|
.Returns(_downloadClients);
|
||||||
|
|
||||||
Mocker.GetMock<IProvideDownloadClient>()
|
Mocker.GetMock<IProvideDownloadClient>()
|
||||||
.Setup(v => v.GetDownloadClient(It.IsAny<DownloadProtocol>()))
|
.Setup(v => v.GetDownloadClient(It.IsAny<DownloadProtocol>(), It.IsAny<int>()))
|
||||||
.Returns<DownloadProtocol>(v => _downloadClients.FirstOrDefault(d => d.Protocol == v));
|
.Returns<DownloadProtocol, int>((v, i) => _downloadClients.FirstOrDefault(d => d.Protocol == v));
|
||||||
|
|
||||||
var episodes = Builder<Book>.CreateListOfSize(2)
|
var episodes = Builder<Book>.CreateListOfSize(2)
|
||||||
.TheFirst(1).With(s => s.Id = 12)
|
.TheFirst(1).With(s => s.Id = 12)
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using FluentMigrator;
|
||||||
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Datastore.Migration
|
||||||
|
{
|
||||||
|
[Migration(030)]
|
||||||
|
public class download_client_per_indexer : NzbDroneMigrationBase
|
||||||
|
{
|
||||||
|
protected override void MainDbUpgrade()
|
||||||
|
{
|
||||||
|
Alter.Table("Indexers").AddColumn("DownloadClientId").AsInt32().WithDefaultValue(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,13 +2,14 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.Cache;
|
using NzbDrone.Common.Cache;
|
||||||
|
using NzbDrone.Core.Download.Clients;
|
||||||
using NzbDrone.Core.Indexers;
|
using NzbDrone.Core.Indexers;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Download
|
namespace NzbDrone.Core.Download
|
||||||
{
|
{
|
||||||
public interface IProvideDownloadClient
|
public interface IProvideDownloadClient
|
||||||
{
|
{
|
||||||
IDownloadClient GetDownloadClient(DownloadProtocol downloadProtocol);
|
IDownloadClient GetDownloadClient(DownloadProtocol downloadProtocol, int indexerId = 0);
|
||||||
IEnumerable<IDownloadClient> GetDownloadClients(bool filterBlockedClients = false);
|
IEnumerable<IDownloadClient> GetDownloadClients(bool filterBlockedClients = false);
|
||||||
IDownloadClient Get(int id);
|
IDownloadClient Get(int id);
|
||||||
}
|
}
|
||||||
@@ -18,17 +19,23 @@ namespace NzbDrone.Core.Download
|
|||||||
private readonly Logger _logger;
|
private readonly Logger _logger;
|
||||||
private readonly IDownloadClientFactory _downloadClientFactory;
|
private readonly IDownloadClientFactory _downloadClientFactory;
|
||||||
private readonly IDownloadClientStatusService _downloadClientStatusService;
|
private readonly IDownloadClientStatusService _downloadClientStatusService;
|
||||||
|
private readonly IIndexerFactory _indexerFactory;
|
||||||
private readonly ICached<int> _lastUsedDownloadClient;
|
private readonly ICached<int> _lastUsedDownloadClient;
|
||||||
|
|
||||||
public DownloadClientProvider(IDownloadClientStatusService downloadClientStatusService, IDownloadClientFactory downloadClientFactory, ICacheManager cacheManager, Logger logger)
|
public DownloadClientProvider(IDownloadClientStatusService downloadClientStatusService,
|
||||||
|
IDownloadClientFactory downloadClientFactory,
|
||||||
|
IIndexerFactory indexerFactory,
|
||||||
|
ICacheManager cacheManager,
|
||||||
|
Logger logger)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_downloadClientFactory = downloadClientFactory;
|
_downloadClientFactory = downloadClientFactory;
|
||||||
_downloadClientStatusService = downloadClientStatusService;
|
_downloadClientStatusService = downloadClientStatusService;
|
||||||
|
_indexerFactory = indexerFactory;
|
||||||
_lastUsedDownloadClient = cacheManager.GetCache<int>(GetType(), "lastDownloadClientId");
|
_lastUsedDownloadClient = cacheManager.GetCache<int>(GetType(), "lastDownloadClientId");
|
||||||
}
|
}
|
||||||
|
|
||||||
public IDownloadClient GetDownloadClient(DownloadProtocol downloadProtocol)
|
public IDownloadClient GetDownloadClient(DownloadProtocol downloadProtocol, int indexerId = 0)
|
||||||
{
|
{
|
||||||
var availableProviders = _downloadClientFactory.GetAvailableProviders().Where(v => v.Protocol == downloadProtocol).ToList();
|
var availableProviders = _downloadClientFactory.GetAvailableProviders().Where(v => v.Protocol == downloadProtocol).ToList();
|
||||||
|
|
||||||
@@ -37,6 +44,18 @@ namespace NzbDrone.Core.Download
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (indexerId > 0)
|
||||||
|
{
|
||||||
|
var indexer = _indexerFactory.Find(indexerId);
|
||||||
|
|
||||||
|
if (indexer != null && indexer.DownloadClientId > 0)
|
||||||
|
{
|
||||||
|
var client = availableProviders.SingleOrDefault(d => d.Definition.Id == indexer.DownloadClientId);
|
||||||
|
|
||||||
|
return client ?? throw new DownloadClientUnavailableException($"Indexer specified download client is not available");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var blockedProviders = new HashSet<int>(_downloadClientStatusService.GetBlockedProviders().Select(v => v.ProviderId));
|
var blockedProviders = new HashSet<int>(_downloadClientStatusService.GetBlockedProviders().Select(v => v.ProviderId));
|
||||||
|
|
||||||
if (blockedProviders.Any())
|
if (blockedProviders.Any())
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ namespace NzbDrone.Core.Download
|
|||||||
Ensure.That(remoteBook.Books, () => remoteBook.Books).HasItems();
|
Ensure.That(remoteBook.Books, () => remoteBook.Books).HasItems();
|
||||||
|
|
||||||
var downloadTitle = remoteBook.Release.Title;
|
var downloadTitle = remoteBook.Release.Title;
|
||||||
var downloadClient = _downloadClientProvider.GetDownloadClient(remoteBook.Release.DownloadProtocol);
|
var downloadClient = _downloadClientProvider.GetDownloadClient(remoteBook.Release.DownloadProtocol, remoteBook.Release.IndexerId);
|
||||||
|
|
||||||
if (downloadClient == null)
|
if (downloadClient == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ namespace NzbDrone.Core.Indexers
|
|||||||
public bool EnableRss { get; set; }
|
public bool EnableRss { get; set; }
|
||||||
public bool EnableAutomaticSearch { get; set; }
|
public bool EnableAutomaticSearch { get; set; }
|
||||||
public bool EnableInteractiveSearch { get; set; }
|
public bool EnableInteractiveSearch { get; set; }
|
||||||
|
public int DownloadClientId { get; set; }
|
||||||
public DownloadProtocol Protocol { get; set; }
|
public DownloadProtocol Protocol { get; set; }
|
||||||
public bool SupportsRss { get; set; }
|
public bool SupportsRss { get; set; }
|
||||||
public bool SupportsSearch { get; set; }
|
public bool SupportsSearch { get; set; }
|
||||||
|
|||||||
@@ -361,6 +361,7 @@
|
|||||||
"IncludeUnknownAuthorItemsHelpText": "Show items without a author in the queue, this could include removed authors, books or anything else in Readarr's category",
|
"IncludeUnknownAuthorItemsHelpText": "Show items without a author in the queue, this could include removed authors, books or anything else in Readarr's category",
|
||||||
"IncludeUnmonitored": "Include Unmonitored",
|
"IncludeUnmonitored": "Include Unmonitored",
|
||||||
"Indexer": "Indexer",
|
"Indexer": "Indexer",
|
||||||
|
"IndexerDownloadClientHelpText": "Specify which download client is used for grabs from this indexer",
|
||||||
"IndexerIdHelpText": "Specify what indexer the profile applies to",
|
"IndexerIdHelpText": "Specify what indexer the profile applies to",
|
||||||
"IndexerIdHelpTextWarning": "Using a specific indexer with preferred words can lead to duplicate releases being grabbed",
|
"IndexerIdHelpTextWarning": "Using a specific indexer with preferred words can lead to duplicate releases being grabbed",
|
||||||
"IndexerJackettAll": "Indexers using the unsupported Jackett 'all' endpoint: {0}",
|
"IndexerJackettAll": "Indexers using the unsupported Jackett 'all' endpoint: {0}",
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ namespace NzbDrone.Core.ThingiProvider
|
|||||||
List<TProviderDefinition> All();
|
List<TProviderDefinition> All();
|
||||||
List<TProvider> GetAvailableProviders();
|
List<TProvider> GetAvailableProviders();
|
||||||
bool Exists(int id);
|
bool Exists(int id);
|
||||||
|
TProviderDefinition Find(int id);
|
||||||
TProviderDefinition Get(int id);
|
TProviderDefinition Get(int id);
|
||||||
TProviderDefinition Create(TProviderDefinition definition);
|
TProviderDefinition Create(TProviderDefinition definition);
|
||||||
void Update(TProviderDefinition definition);
|
void Update(TProviderDefinition definition);
|
||||||
|
|||||||
@@ -101,6 +101,11 @@ namespace NzbDrone.Core.ThingiProvider
|
|||||||
return _providerRepository.Get(id);
|
return _providerRepository.Get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TProviderDefinition Find(int id)
|
||||||
|
{
|
||||||
|
return _providerRepository.Find(id);
|
||||||
|
}
|
||||||
|
|
||||||
public virtual TProviderDefinition Create(TProviderDefinition definition)
|
public virtual TProviderDefinition Create(TProviderDefinition definition)
|
||||||
{
|
{
|
||||||
var result = _providerRepository.Insert(definition);
|
var result = _providerRepository.Insert(definition);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ namespace Readarr.Api.V1.Indexers
|
|||||||
public bool SupportsSearch { get; set; }
|
public bool SupportsSearch { get; set; }
|
||||||
public DownloadProtocol Protocol { get; set; }
|
public DownloadProtocol Protocol { get; set; }
|
||||||
public int Priority { get; set; }
|
public int Priority { get; set; }
|
||||||
|
public int DownloadClientId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class IndexerResourceMapper : ProviderResourceMapper<IndexerResource, IndexerDefinition>
|
public class IndexerResourceMapper : ProviderResourceMapper<IndexerResource, IndexerDefinition>
|
||||||
@@ -31,6 +32,7 @@ namespace Readarr.Api.V1.Indexers
|
|||||||
resource.SupportsSearch = definition.SupportsSearch;
|
resource.SupportsSearch = definition.SupportsSearch;
|
||||||
resource.Protocol = definition.Protocol;
|
resource.Protocol = definition.Protocol;
|
||||||
resource.Priority = definition.Priority;
|
resource.Priority = definition.Priority;
|
||||||
|
resource.DownloadClientId = definition.DownloadClientId;
|
||||||
|
|
||||||
return resource;
|
return resource;
|
||||||
}
|
}
|
||||||
@@ -48,6 +50,7 @@ namespace Readarr.Api.V1.Indexers
|
|||||||
definition.EnableAutomaticSearch = resource.EnableAutomaticSearch;
|
definition.EnableAutomaticSearch = resource.EnableAutomaticSearch;
|
||||||
definition.EnableInteractiveSearch = resource.EnableInteractiveSearch;
|
definition.EnableInteractiveSearch = resource.EnableInteractiveSearch;
|
||||||
definition.Priority = resource.Priority;
|
definition.Priority = resource.Priority;
|
||||||
|
definition.DownloadClientId = resource.DownloadClientId;
|
||||||
|
|
||||||
return definition;
|
return definition;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user