Add optional value to search for Manga instead of downloading all
GetPublications(string = null)
This commit is contained in:
parent
b15e032038
commit
c3cb4d6e08
@ -6,7 +6,7 @@ public abstract class Connector
|
||||
{
|
||||
internal abstract string downloadLocation { get; }
|
||||
public abstract string name { get; }
|
||||
public abstract Publication[] GetPublications();
|
||||
public abstract Publication[] GetPublications(string publicationTitle = "");
|
||||
public abstract Chapter[] GetChapters(Publication publication);
|
||||
public abstract void DownloadChapter(Publication publication, Chapter chapter); //where to?
|
||||
|
||||
|
@ -15,10 +15,10 @@ public class MangaDex : Connector
|
||||
this.downloadLocation = downloadLocation;
|
||||
}
|
||||
|
||||
public override Publication[] GetPublications()
|
||||
public override Publication[] GetPublications(string publicationTitle = "")
|
||||
{
|
||||
const int limit = 100;
|
||||
string publicationsUrl = $"https://api.mangadex.org/manga?limit={limit}&offset=";
|
||||
string publicationsUrl = $"https://api.mangadex.org/manga?limit={limit}&title={publicationTitle}&offset=";
|
||||
int offset = 0;
|
||||
int total = int.MaxValue;
|
||||
HashSet<Publication> publications = new();
|
||||
|
Loading…
Reference in New Issue
Block a user