Skip to content

Commit

Permalink
Merge pull request #9 from romaduck/master
Browse files Browse the repository at this point in the history
Adding a checking for the first and last verses in passage
  • Loading branch information
rkazakov committed Apr 16, 2016
2 parents ec99cab + 98ea026 commit 82204ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ node_modules

# Users Environment Variables
.lock-wscript

# IDE directory
.idea
10 changes: 7 additions & 3 deletions server/fetcher.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'
'use strict';

const _ = require('lodash');

Expand Down Expand Up @@ -54,10 +54,14 @@ exports.fetchRange = function fetchRange(passage, callback) {
var endVerse = translationInfo.chapters[passage.start.b][ch-1];

if (ch === passage.start.c) {
startVerse = passage.start.v;
if (passage.start.v) {
startVerse = passage.start.v;
}
}
if (ch === passage.end.c) {
endVerse = passage.end.v;
if (passage.end.v) {
endVerse = passage.end.v;
}
}

chapters.push({'tran':pTranslation, 'bookRef':passage.start.b, 'chapter':ch, 'verse':{$gte:startVerse, $lte:endVerse}});
Expand Down

0 comments on commit 82204ed

Please sign in to comment.