DanishBits: add Passkey info to hopefully prevent #1892 #1873 #1850 (#1925)

* DanishBits: add Passkey info to hopefully prevent #1892 #1873 #1850

**WARNING** this is a completely untested code change, as I don't have VS or a c# compiler.      
I simply made my best guess based on similar code I found in TorrentBytes.cs
Please review carefully, and hopefully I haven't left anything out ;-)
If you don't want me to make future changes like this without the required tools, then please let me know. Thanks.

* Update DanishBits.cs

* Update DanishBits.cs

* Update DanishBits.cs

* Update DanishBits.cs

* Update DanishBits.cs

* Update DanishBits.cs

* Update ConfigurationDataUserPasskey.cs

add display item instructions

* Update DanishBits.cs

switch to ConfigurationDataUserPasskey
and drop unused using statements

* Update CouchPotatoTracker.cs

add ConfigurationDataUserPasskey ConfigData1

* Update CouchPotatoTracker.cs

fix optional configData parm override

* revert

oops no, that wipes preloaded data :(

* Update CouchPotatoTracker.cs

add configurationDataUserPasskey as parameter
This commit is contained in:
garfield69 2017-10-06 21:36:04 +13:00 committed by kaso17
parent 2ab6d13493
commit 851a4d30e1
3 changed files with 18 additions and 7 deletions

View File

@ -1,4 +1,4 @@
using Jackett.Models;
using Jackett.Models;
using Jackett.Models.IndexerConfig;
using Jackett.Services;
using Jackett.Utils;
@ -23,7 +23,7 @@ namespace Jackett.Indexers.Abstract
set { base.configData = value; }
}
public CouchPotatoTracker(IIndexerConfigurationService configService, IWebClient client, Logger logger, IProtectionService p, string name, string description, string link, string endpoint)
public CouchPotatoTracker(IIndexerConfigurationService configService, IWebClient client, Logger logger, IProtectionService p, ConfigurationDataUserPasskey configData, string name, string description, string link, string endpoint)
: base(name: name,
description: description,
link: link,
@ -32,7 +32,8 @@ namespace Jackett.Indexers.Abstract
client: client,
logger: logger,
p: p,
configData: new ConfigurationDataUserPasskey())
configData: configData
)
{
this.endpoint = endpoint;
TorznabCaps.SupportsImdbSearch = true;

View File

@ -1,4 +1,4 @@
using Jackett.Models;
using Jackett.Models;
using Jackett.Services;
using Jackett.Utils.Clients;
using NLog;
@ -7,11 +7,18 @@ using Jackett.Indexers.Abstract;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using Jackett.Models.IndexerConfig;
namespace Jackett.Indexers
{
public class DanishBits : CouchPotatoTracker
{
new ConfigurationDataUserPasskey configData
{
get { return (ConfigurationDataUserPasskey)base.configData; }
set { base.configData = value; }
}
public DanishBits(IIndexerConfigurationService configService, IWebClient c, Logger l, IProtectionService ps)
: base(name: "DanishBits",
description: "A danish closed torrent tracker",
@ -20,8 +27,9 @@ namespace Jackett.Indexers
configService: configService,
client: c,
logger: l,
p: ps
)
p: ps,
configData: new ConfigurationDataUserPasskey("Note about Passkey: This is not your login Password. Find the Passkey by logging into DanishBits with your Browser, and under your account page you'll see your passkey under the 'Personal' section on the left side.")
)
{
Encoding = Encoding.GetEncoding("UTF-8");
Language = "da-dk";

View File

@ -1,14 +1,16 @@
namespace Jackett.Models.IndexerConfig
namespace Jackett.Models.IndexerConfig
{
public class ConfigurationDataUserPasskey : ConfigurationData
{
public StringItem Username { get; private set; }
public StringItem Passkey { get; private set; }
public DisplayItem Instructions { get; private set; }
public ConfigurationDataUserPasskey(string instructionMessageOptional = null)
{
Username = new StringItem { Name = "Username" };
Passkey = new StringItem { Name = "Passkey" };
Instructions = new DisplayItem(instructionMessageOptional) { Name = "" };
}
}
}