fix nsfw search flag

This commit is contained in:
Akinwale Ariwodola 2020-06-05 07:23:56 +01:00
parent cc1ddfa16e
commit b36813ebe6

View file

@ -40,9 +40,11 @@ public class Lighthouse {
Uri.Builder uriBuilder = Uri.parse(String.format("%s/search", CONNECTION_STRING)).buildUpon().
appendQueryParameter("s", rawQuery).
appendQueryParameter("resolve", "true").
appendQueryParameter("nsfw", String.valueOf(nsfw).toLowerCase()).
appendQueryParameter("size", String.valueOf(size)).
appendQueryParameter("from", String.valueOf(from));
if (!nsfw) {
uriBuilder.appendQueryParameter("nsfw", String.valueOf(nsfw).toLowerCase());
}
if (!Helper.isNullOrEmpty(relatedTo)) {
uriBuilder.appendQueryParameter("related_to", relatedTo);
}