Skip to content

fix: off by one error when returning list of seasons#29

Merged
MagicTheDev merged 1 commit into
ClashKingInc:masterfrom
lynchdean:fix/season-list-range
May 25, 2026
Merged

fix: off by one error when returning list of seasons#29
MagicTheDev merged 1 commit into
ClashKingInc:masterfrom
lynchdean:fix/season-list-range

Conversation

@lynchdean

Copy link
Copy Markdown
Contributor

Currently list/seasons returns a list of length last + 1. (last is the arg given for the number of seasons)

I believe that it makes most sense that this endpoint should return a list that is the length of last and not last + 1. For example, if I want a list of the last 4 seasons I should enter 4 as last, not 3.

I understand that this might cause some issues with projects built on using this endpoint but this change makes most sense from a pure functionality point of view, in my own opinion.

Copilot AI review requested due to automatic review settings May 20, 2026 12:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adjusts the season listing logic by changing the iteration bounds when generating past season dates.

Changes:

  • Updated the loop range in list_seasons to iterate over fewer months (exclusive upper bound).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread routers/public/list.py
last = min(last, 1000)
dates = []
for x in range(0, last + 1):
for x in range(0, last):
@MagicTheDev

MagicTheDev commented May 20, 2026

Copy link
Copy Markdown
Member

Yea this is a fine change, I'll merge tonight, thanks

@MagicTheDev MagicTheDev merged commit 515979b into ClashKingInc:master May 25, 2026
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants