esvapi: style fixes
This commit is contained in:
parent
df6abbf50c
commit
91dc7cd07e
1 changed files with 3 additions and 7 deletions
10
esvapi.d
10
esvapi.d
|
@ -41,11 +41,8 @@ enum ESVIndent
|
||||||
TAB
|
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. +/
|
/++ Constant array of all books in the Bible. +/
|
||||||
immutable string[] BIBLE_BOOKS = [
|
immutable string[] bibleBooks = [
|
||||||
/* Old Testament */
|
/* Old Testament */
|
||||||
"Genesis",
|
"Genesis",
|
||||||
"Exodus",
|
"Exodus",
|
||||||
|
@ -66,7 +63,6 @@ immutable string[] BIBLE_BOOKS = [
|
||||||
"Esther",
|
"Esther",
|
||||||
"Job",
|
"Job",
|
||||||
"Psalm",
|
"Psalm",
|
||||||
"Psalms", /* both are valid */
|
|
||||||
"Proverbs",
|
"Proverbs",
|
||||||
"Ecclesiastes",
|
"Ecclesiastes",
|
||||||
"Song of Solomon",
|
"Song of Solomon",
|
||||||
|
@ -147,7 +143,7 @@ immutable string[] ESVAPI_PARAMETERS = [
|
||||||
bool
|
bool
|
||||||
bookValid(in char[] book) nothrow
|
bookValid(in char[] book) nothrow
|
||||||
{
|
{
|
||||||
foreach (string b; BIBLE_BOOKS) {
|
foreach (string b; bibleBooks) {
|
||||||
if (book.capitalize() == b.capitalize())
|
if (book.capitalize() == b.capitalize())
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -202,7 +198,7 @@ class ESVApi
|
||||||
{
|
{
|
||||||
_key = key;
|
_key = key;
|
||||||
_tmp = tempDir() ~ tmpName;
|
_tmp = tempDir() ~ tmpName;
|
||||||
_url = ESVAPI_URL;
|
_url = "https://api.esv.org/v3/passage";
|
||||||
opts = ESVApiOptions(true);
|
opts = ESVApiOptions(true);
|
||||||
extraParameters = "";
|
extraParameters = "";
|
||||||
onProgress = delegate int (size_t dlTotal, size_t dlNow,
|
onProgress = delegate int (size_t dlTotal, size_t dlNow,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue