Skip to content

Commit

Permalink
crawler.py: Use 1 based indexing in get_chapter_index_of
Browse files Browse the repository at this point in the history
  • Loading branch information
dipu-bd committed Dec 2, 2018
1 parent bd9cc37 commit 801e530
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lightnovel_crawler/utils/crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ def download_chapter_body(self, chapter):
# end def

def get_chapter_index_of(self, url):
'''Return the index of chapter by given url or -1'''
'''Return the index of chapter by given url or 0'''
url = (url or '').strip().strip('/')
for i, chapter in enumerate(self.chapters):
for chapter in self.chapters:
if chapter['url'] == url:
return i
return chapter['id']
# end if
# end for
return -1
return 0
# end def

# ------------------------------------------------------------------------- #
Expand Down

0 comments on commit 801e530

Please sign in to comment.