Skip to content

New: Add {Season Year} renaming token#8052

Draft
Yashizzle wants to merge 3 commits intoSonarr:v5-developfrom
Yashizzle:add-season-year-renaming-token
Draft

New: Add {Season Year} renaming token#8052
Yashizzle wants to merge 3 commits intoSonarr:v5-developfrom
Yashizzle:add-season-year-renaming-token

Conversation

@Yashizzle
Copy link
Copy Markdown
Contributor

@Yashizzle Yashizzle commented Sep 4, 2025

Description

  • This chooses the year the first episode in the season aired and sets it using the {Season Year} token.
  • On seasons that span across years, only the first year will be set
  • When the aired date of the first episode of the season is not available, the year will be set to Unknown

Screenshots for UI Changes

  • File name samples
image
  • File renaming
image
  • Folder Name Tokens - Help Text
image

Issues Fixed or Closed by this PR

This chooses the year the first episode in the season aired and sets
that as the `Season Year`.

Closes: Sonarr#7667
@Yashizzle
Copy link
Copy Markdown
Contributor Author

Hi All... It's my first time contributing to your wonderful project. I picked an issue that seemed simple. I've done a bit more testing and it seems like everything works as intended. Please let me know your thoughts and I'll mark it as ready for review if I'm on the right path. Thanks in advance !

Copy link
Copy Markdown
Member

@markus101 markus101 left a comment

Choose a reason for hiding this comment

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

Looks pretty solid, just some small improvements. Make sure you mark it ready for review or it will be filtered out from reviewing.

Comment thread src/NzbDrone.Core/Organizer/FileNameSampleService.cs Outdated
Comment thread src/NzbDrone.Core/Organizer/FileNameBuilder.cs Outdated
Comment thread src/NzbDrone.Core.Test/OrganizerTests/GetSeasonFolderFixture.cs Outdated
@Yashizzle
Copy link
Copy Markdown
Contributor Author

Updated to address the comments. Thank you @markus101 !!

Updated Screenshot
image

@Yashizzle Yashizzle marked this pull request as ready for review September 11, 2025 23:27

var seasonPath = BuildSeasonPath(series, episodes.First().SeasonNumber);
var firstEpisode = episodes.First();
var seasonPath = BuildSeasonPath(series, firstEpisode.SeasonNumber, firstEpisode.AirDateUtc?.Year);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I missed this the first time, but this could result in seasons that span multiple years having folders for different years depending which episodes are imported.

Season years is being added (starting with Skyhook), but it's not available yet, for now I'm going to convert this PR to a draft pending that addition.

@markus101 markus101 marked this pull request as draft September 27, 2025 19:02
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.

Add {Season Year} Renaming Token

2 participants