Fix off-by-one error

The 'add one to account for starting at 1' only applies if we did the subtraction bit, which we don't on reverse listings. Fixing that means we're golden.

Fixes #1.
This commit is contained in:
Robert Miles 2023-03-17 07:42:49 +00:00
parent 604c8987b5
commit 302d352da4
1 changed files with 1 additions and 1 deletions

2
app.py
View File

@ -92,9 +92,9 @@ def abstract_listing_generator(listing_file,header_file=None,header_text=None,li
log_name, log_link = line[1:].strip().split("\t")
if count_from_end:
log_num = total_line_count-line_count
log_num += 1 # account for numbers starting at 1 and not 0
else:
log_num = line_count
log_num += 1 # account for numbers starting at 1 and not 0
log_link = urllib.parse.quote(log_link,safe='/')
yield f"=> {log_link} {log_num} >> {log_name}\n"