Misc indexer fixes

pull/10/head
Qstick 4 years ago
parent 3ef2e0b384
commit 08d5505b11

@ -60,6 +60,14 @@ namespace NzbDrone.Core.Indexers.Cardigann
private IndexerDefinition GetDefinition(CardigannMetaDefinition definition)
{
var defaultSettings = new List<SettingsField>
{
new SettingsField { Name = "username", Label = "Username", Type = "text" },
new SettingsField { Name = "password", Label = "Password", Type = "password" }
};
var settings = definition.Settings ?? defaultSettings;
return new IndexerDefinition
{
Enable = true,
@ -71,7 +79,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
SupportsRss = SupportsRss,
SupportsSearch = SupportsSearch,
Capabilities = new IndexerCapabilities(),
ExtraFields = definition.Settings
ExtraFields = settings
};
}

@ -216,7 +216,15 @@ namespace NzbDrone.Core.Indexers.Cardigann
_logger.Debug("Populating config vars");
foreach (var setting in _definition.Settings)
var defaultSettings = new List<SettingsField>
{
new SettingsField { Name = "username", Label = "Username", Type = "text" },
new SettingsField { Name = "password", Label = "Password", Type = "password" }
};
var settings = _definition.Settings ?? defaultSettings;
foreach (var setting in settings)
{
var name = ".Config." + setting.Name;
var value = _settings.ExtraFieldData.GetValueOrDefault(setting.Name, setting.Default);

@ -294,10 +294,10 @@ namespace NzbDrone.Core.Indexers.Definitions
Passphrase = "";
}
[FieldDefinition(1, Label = "UID", Advanced = true, HelpText = "Uid from login cookie")]
[FieldDefinition(1, Label = "UID", HelpText = "Uid from login cookie")]
public string UId { get; set; }
[FieldDefinition(2, Label = "Passphrase", Advanced = true, HelpText = "Pass from login cookie")]
[FieldDefinition(2, Label = "Passphrase", HelpText = "Pass from login cookie")]
public string Passphrase { get; set; }
public NzbDroneValidationResult Validate()

@ -85,6 +85,8 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
flags |= IndexerFlags.G_Scene;
}
var free = !(torrent.FreeleechType is null);
// Only add approved torrents
try
{
@ -103,6 +105,10 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
Approved = torrent.Checked,
ImdbId = result.ImdbId.IsNotNullOrWhiteSpace() ? int.Parse(result.ImdbId) : 0,
IndexerFlags = flags,
MinimumRatio = 1,
MinimumSeedTime = 345600,
DownloadVolumeFactor = free ? 0 : 1,
UploadVolumeFactor = 1,
Category = new List<IndexerCategory> { NewznabStandardCategory.Movies }
});
}

Loading…
Cancel
Save