Add Connectors to Tranga
This commit is contained in:
parent
e6a3fa2899
commit
565bc0775d
@ -1,5 +1,6 @@
|
|||||||
using Logging;
|
using Logging;
|
||||||
using Tranga.Jobs;
|
using Tranga.Jobs;
|
||||||
|
using Tranga.MangaConnectors;
|
||||||
|
|
||||||
namespace Tranga;
|
namespace Tranga;
|
||||||
|
|
||||||
@ -8,15 +9,36 @@ public partial class Tranga : GlobalBase
|
|||||||
public bool keepRunning;
|
public bool keepRunning;
|
||||||
private JobBoss _jobBoss;
|
private JobBoss _jobBoss;
|
||||||
private Server server;
|
private Server server;
|
||||||
|
private HashSet<MangaConnector> connectors;
|
||||||
|
|
||||||
public Tranga(Logger? logger, TrangaSettings settings) : base(logger, settings)
|
public Tranga(Logger? logger, TrangaSettings settings) : base(logger, settings)
|
||||||
{
|
{
|
||||||
keepRunning = true;
|
keepRunning = true;
|
||||||
_jobBoss = new(this);
|
_jobBoss = new(this);
|
||||||
|
connectors = new HashSet<MangaConnector>()
|
||||||
|
{
|
||||||
|
new Manganato(this),
|
||||||
|
new Mangasee(this),
|
||||||
|
new MangaDex(this),
|
||||||
|
new MangaKatana(this)
|
||||||
|
};
|
||||||
StartJobBoss();
|
StartJobBoss();
|
||||||
this.server = new Server(this);
|
this.server = new Server(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MangaConnector? GetConnector(string name)
|
||||||
|
{
|
||||||
|
foreach(MangaConnector mc in connectors)
|
||||||
|
if (mc.name.Equals(name, StringComparison.InvariantCultureIgnoreCase))
|
||||||
|
return mc;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<MangaConnector> GetConnectors()
|
||||||
|
{
|
||||||
|
return connectors;
|
||||||
|
}
|
||||||
|
|
||||||
private void StartJobBoss()
|
private void StartJobBoss()
|
||||||
{
|
{
|
||||||
Thread t = new (() =>
|
Thread t = new (() =>
|
||||||
|
Loading…
Reference in New Issue
Block a user