fixed URL when adding an indexer
This commit is contained in:
parent
332136bc6f
commit
e00b216eef
|
@ -43,27 +43,27 @@ namespace NzbDrone.Api
|
||||||
|
|
||||||
private List<TProviderResource> GetAll()
|
private List<TProviderResource> GetAll()
|
||||||
{
|
{
|
||||||
var indexerDefinitions = _providerFactory.All();
|
var providerDefinitions = _providerFactory.All();
|
||||||
|
|
||||||
var result = new List<TProviderResource>(indexerDefinitions.Count);
|
var result = new List<TProviderResource>(providerDefinitions.Count);
|
||||||
|
|
||||||
foreach (var definition in indexerDefinitions)
|
foreach (var definition in providerDefinitions)
|
||||||
{
|
{
|
||||||
var indexerResource = new TProviderResource();
|
var providerResource = new TProviderResource();
|
||||||
indexerResource.InjectFrom(definition);
|
providerResource.InjectFrom(definition);
|
||||||
indexerResource.Fields = SchemaBuilder.ToSchema(definition.Settings);
|
providerResource.Fields = SchemaBuilder.ToSchema(definition.Settings);
|
||||||
|
|
||||||
result.Add(indexerResource);
|
result.Add(providerResource);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int CreateProvider(TProviderResource indexerResource)
|
private int CreateProvider(TProviderResource providerResource)
|
||||||
{
|
{
|
||||||
var indexer = GetDefinition(indexerResource);
|
var provider = GetDefinition(providerResource);
|
||||||
indexer = _providerFactory.Create(indexer);
|
provider = _providerFactory.Create(provider);
|
||||||
return indexer.Id;
|
return provider.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateProvider(TProviderResource providerResource)
|
private void UpdateProvider(TProviderResource providerResource)
|
||||||
|
|
|
@ -33,7 +33,7 @@ define(
|
||||||
schemaCollection.url = StatusModel.get('urlBase') + '/api/indexer/schema';
|
schemaCollection.url = StatusModel.get('urlBase') + '/api/indexer/schema';
|
||||||
schemaCollection.fetch({
|
schemaCollection.fetch({
|
||||||
success: function (collection) {
|
success: function (collection) {
|
||||||
collection.url = './api/indexer';
|
collection.url = StatusModel.get('urlBase') + '/api/indexer';
|
||||||
var model = _.first(collection.models);
|
var model = _.first(collection.models);
|
||||||
|
|
||||||
model.set({
|
model.set({
|
||||||
|
|
Loading…
Reference in New Issue