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
|
||||
}
|
||||
|
||||
/++ 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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue