esvapi: style fixes

This commit is contained in:
Jeremy Baxter 2024-06-26 13:10:57 +12:00
parent df6abbf50c
commit 91dc7cd07e

View file

@ -41,11 +41,8 @@ enum ESVIndent
TAB
}
/++ Default URL to use when sending API requests. +/
enum ESVAPI_URL = "https://api.esv.org/v3/passage";
/++ Constant array of all books in the Bible. +/
immutable string[] BIBLE_BOOKS = [
immutable string[] bibleBooks = [
/* Old Testament */
"Genesis",
"Exodus",
@ -66,7 +63,6 @@ immutable string[] BIBLE_BOOKS = [
"Esther",
"Job",
"Psalm",
"Psalms", /* both are valid */
"Proverbs",
"Ecclesiastes",
"Song of Solomon",
@ -147,7 +143,7 @@ immutable string[] ESVAPI_PARAMETERS = [
bool
bookValid(in char[] book) nothrow
{
foreach (string b; BIBLE_BOOKS) {
foreach (string b; bibleBooks) {
if (book.capitalize() == b.capitalize())
return true;
}
@ -202,7 +198,7 @@ class ESVApi
{
_key = key;
_tmp = tempDir() ~ tmpName;
_url = ESVAPI_URL;
_url = "https://api.esv.org/v3/passage";
opts = ESVApiOptions(true);
extraParameters = "";
onProgress = delegate int (size_t dlTotal, size_t dlNow,