Skip to content

feat: add option to group upcoming episodes by series - #244

Open
igorolc wants to merge 13 commits into
IAmParadox27:mainfrom
igorolc:feat/group-upcoming
Open

feat: add option to group upcoming episodes by series#244
igorolc wants to merge 13 commits into
IAmParadox27:mainfrom
igorolc:feat/group-upcoming

Conversation

@igorolc

@igorolc igorolc commented Jun 19, 2026

Copy link
Copy Markdown

This PR introduces an option in the Sonarr configuration section to group upcoming episodes by series.

Why is this needed?

Currently, if a series has multiple upcoming episodes listed in the calendar, the "Upcoming Shows" section on the home screen displays each episode individually, causing duplicate entries for the same series. This change allows users to group upcoming episodes so only the next immediate episode for each series is shown, reducing clutter on the home screen.

Changes:

  • PluginConfiguration.cs: Added boolean flag GroupUpcoming to the Sonarr service configuration (default: false for backwards compatibility).
  • config.html: Added a checkbox Group upcoming episodes by series in the Sonarr configuration panel with a description.
  • UpcomingShowsSection.cs: Modified FilterAndSortItems to group sonarr calendar items by SeriesId and select the first chronological episode per series when GroupUpcoming is enabled.

Visual Comparison:

Before (Duplicate upcoming episodes) After (Grouped by series)
Captura Antigo Captura Novo

Disclaimer:

I am not a professional developer. I solved this issue for my personal setup to fix home screen clutter and decided to share it back to help others who might have the same preference. An AI assistant (Gemini/Antigravity) was used to help structure the code edits and prepare this Pull Request.

@AdamWHY2K AdamWHY2K left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good idea! i have a couple small changes to suggest, but LGTM once those are addressed

edit: actually, thinking about this a little more, it would be nice if the grouped series showed how many episodes are upcoming, then we could drop the name of the first episode too.

it can be as simple as S##E##-##, so for your example it would be S03E01-10

Comment thread src/Jellyfin.Plugin.HomeScreenSections/Configuration/config.html Outdated
Comment thread src/Jellyfin.Plugin.HomeScreenSections/Configuration/config.html Outdated
Comment thread screenshots/sonarr-group-upcoming-disabled.png
@igorolc

igorolc commented Jun 22, 2026

Copy link
Copy Markdown
Author

Hi! I have updated the code addressing all your suggestions:

  1. Images: I moved and renamed the images as recommended.

  2. Flexible Grouping Options (Two Mutually Exclusive Checkboxes): To offer better flexibility, instead of just grouping the range in one single way, I implemented two separate and mutually exclusive options in the Sonarr configuration panel:

    • "Group upcoming episodes by series" (AdminSonarrGroupUpcoming): Groups upcoming episodes into a range (e.g., S03E01-10). To prevent confusion about whether all episodes will be released on the first day, I changed the frequency label from raw "Weekly"/"Daily" to "1 episode per week" / "1 episode per day".
    • "Show only the next episode of each series" (AdminSonarrGroupUpcomingNextOnly): Displays only the single next upcoming episode in the standard format (e.g., S03E01 - [Title]) and automatically hides it if it does not have a definitive title yet (e.g., TBA/TDA/TBD).

    Checking one option on the admin page automatically unchecks the other to prevent any conflicts.

  3. Countdown & Frequency Localization: Added the missing translation keys to en.json, pt.json, and pt-BR.json so that the upcoming countdowns (days, weeks, etc.) and frequencies are fully translated on the Jellyfin home screen. I also added a fallback to the browser/document language in case the user's localized key in localStorage is empty.


Please note: I do not speak English fluently and I am using a translation tool to communicate. I apologize for any awkward phrasing or grammatical errors!

Comment thread src/Jellyfin.Plugin.HomeScreenSections/Configuration/config.html Outdated

@IAmParadox27 IAmParadox27 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

General comments, particularly relating to the translation manager, how its grabbed and how its being used.

Comment thread src/Jellyfin.Plugin.HomeScreenSections/HomeScreen/Sections/UpcomingSectionBase.cs Outdated
Comment thread src/Jellyfin.Plugin.HomeScreenSections/HomeScreen/Sections/UpcomingSectionBase.cs Outdated
@igorolc

igorolc commented Jul 9, 2026

Copy link
Copy Markdown
Author

well, I've never had conflicts in a GitHub repository before.
i talked to a friend who works in programming (I only do it as a hobby), i hope I've corrected it correctly haha

thank you for your patience!

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