Skip to content

fix: use highest season number for season count - #47

Merged
cbackas merged 2 commits into
cbackas:mainfrom
SpackledJim:fix/season-count
Oct 3, 2026
Merged

cbackas merged 2 commits into
cbackas:mainfrom
SpackledJim:fix/season-count

Conversation

@SpackledJim

Copy link
Copy Markdown
Contributor

Show embed "Seasons" field shows the number of season records, not seasons

Commit: 02a3fbe — fix: use highest season number for season count

Cause

buildShowEmbed in src/lib/messages.ts used tvdbSeries.seasons.length. TVDB can return several records per season (one per season type, e.g. official and DVD ordering), so the length can exceed the actual season count.

Fix

value: Math.max(0, ...tvdbSeries.seasons.map((s) => s.number ?? 0)).toFixed(0),
  • Records without a number count as 0.
  • The leading 0 makes an empty list return 0 instead of -Infinity.
  • Specials in season 0 don't affect the count.

SpackledJim and others added 2 commits September 29, 2026 15:08
The show embed counted the entries in the seasons list, which gave the
wrong number. It now shows the highest season number in that list.
Seasons without a number count as 0, and an empty list shows 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cbackas
cbackas merged commit 07b3c83 into cbackas:main Oct 3, 2026
9 checks passed
@cbackas

cbackas commented Oct 3, 2026

Copy link
Copy Markdown
Owner

🎉 This PR is included in version 4.2.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@SpackledJim
SpackledJim deleted the fix/season-count branch October 3, 2026 23:06
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.

2 participants