mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Mylar code cleanup
This commit is contained in:
@@ -19,10 +19,10 @@ namespace NzbDrone.Core.Applications.Mylar
|
|||||||
private readonly IMylarV3Proxy _mylarV3Proxy;
|
private readonly IMylarV3Proxy _mylarV3Proxy;
|
||||||
private readonly IConfigFileProvider _configFileProvider;
|
private readonly IConfigFileProvider _configFileProvider;
|
||||||
|
|
||||||
public Mylar(IMylarV3Proxy lidarrV1Proxy, IConfigFileProvider configFileProvider, IAppIndexerMapService appIndexerMapService, Logger logger)
|
public Mylar(IMylarV3Proxy mylarV3Proxy, IConfigFileProvider configFileProvider, IAppIndexerMapService appIndexerMapService, Logger logger)
|
||||||
: base(appIndexerMapService, logger)
|
: base(appIndexerMapService, logger)
|
||||||
{
|
{
|
||||||
_mylarV3Proxy = lidarrV1Proxy;
|
_mylarV3Proxy = mylarV3Proxy;
|
||||||
_configFileProvider = configFileProvider;
|
_configFileProvider = configFileProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,9 +70,9 @@ namespace NzbDrone.Core.Applications.Mylar
|
|||||||
{
|
{
|
||||||
if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any())
|
if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any())
|
||||||
{
|
{
|
||||||
var lidarrIndexer = BuildMylarIndexer(indexer, indexer.Protocol);
|
var mylarIndexer = BuildMylarIndexer(indexer, indexer.Protocol);
|
||||||
|
|
||||||
var remoteIndexer = _mylarV3Proxy.AddIndexer(lidarrIndexer, Settings);
|
var remoteIndexer = _mylarV3Proxy.AddIndexer(mylarIndexer, Settings);
|
||||||
_appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerName = $"{remoteIndexer.Type},{remoteIndexer.Name}" });
|
_appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerName = $"{remoteIndexer.Type},{remoteIndexer.Name}" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ namespace NzbDrone.Core.Applications.Mylar
|
|||||||
{
|
{
|
||||||
var schema = protocol == DownloadProtocol.Usenet ? MylarProviderType.Newznab : MylarProviderType.Torznab;
|
var schema = protocol == DownloadProtocol.Usenet ? MylarProviderType.Newznab : MylarProviderType.Torznab;
|
||||||
|
|
||||||
var lidarrIndexer = new MylarIndexer
|
var mylarIndexer = new MylarIndexer
|
||||||
{
|
{
|
||||||
Name = originalName ?? $"{indexer.Name} (Prowlarr)",
|
Name = originalName ?? $"{indexer.Name} (Prowlarr)",
|
||||||
Altername = $"{indexer.Name} (Prowlarr)",
|
Altername = $"{indexer.Name} (Prowlarr)",
|
||||||
@@ -148,7 +148,7 @@ namespace NzbDrone.Core.Applications.Mylar
|
|||||||
Type = schema,
|
Type = schema,
|
||||||
};
|
};
|
||||||
|
|
||||||
return lidarrIndexer;
|
return mylarIndexer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Applications.Mylar
|
namespace NzbDrone.Core.Applications.Mylar
|
||||||
{
|
{
|
||||||
public class MylarError
|
public class MylarError
|
||||||
|
@@ -1,22 +0,0 @@
|
|||||||
namespace NzbDrone.Core.Applications.Mylar
|
|
||||||
{
|
|
||||||
public class MylarField
|
|
||||||
{
|
|
||||||
public int Order { get; set; }
|
|
||||||
public string Name { get; set; }
|
|
||||||
public string Label { get; set; }
|
|
||||||
public string Unit { get; set; }
|
|
||||||
public string HelpText { get; set; }
|
|
||||||
public string HelpLink { get; set; }
|
|
||||||
public object Value { get; set; }
|
|
||||||
public string Type { get; set; }
|
|
||||||
public bool Advanced { get; set; }
|
|
||||||
public string Section { get; set; }
|
|
||||||
public string Hidden { get; set; }
|
|
||||||
|
|
||||||
public MylarField Clone()
|
|
||||||
{
|
|
||||||
return (MylarField)MemberwiseClone();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,13 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
|
||||||
using FluentValidation.Results;
|
using FluentValidation.Results;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.Http;
|
using NzbDrone.Common.Http;
|
||||||
using NzbDrone.Common.Serializer;
|
|
||||||
using NzbDrone.Core.Indexers;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Applications.Mylar
|
namespace NzbDrone.Core.Applications.Mylar
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user