Skip to content
Ricky Setiawan edited this page Nov 26, 2020 · 1 revision

Question: How to add a new client that BooruDex not support??

Answer: There 3 answers:

  1. Contribute with making a pull request
  2. The client is compatible with the current available template. Then follow this steps.
  3. The client is not compatible with the current available template. Then make a new template follow this steps.

Steps to make a new client

1. Make class that inherit one of the template (Boorudex.Booru.Template)

public class NewBooru : Moebooru
{

}

2. Make constructor and pass the website url

public class NewBooru : Moebooru
{
    public NewBooru(HttpClient httpClient = null) : base("http://new-booru.com/", httpClient)
    {

    }
}

3. Override some or all method if algorithm and how to handle the JSON response is different.

Steps to make a new template

1. Make class that inherit BooruDex.Booru.Booru

public class TemplateBooru : Booru
{

}

2. Override all necessary method from BooruDex.Booru.Booru

public class TemplateBooru : Booru
{
    public TemplateBooru (string domain, HttpClient httpClient = null) : base(domain, httpClient)
    {

    }

    // override necessary method
    // ...
    // ...
}

3. Then make a new client, follow this steps.