Skip to content

Expanded date fields - #2276

Open
ermmmwafle wants to merge 10 commits into
jeffvli:developmentfrom
ermmmwafle:navidrome-date
Open

Expanded date fields#2276
ermmmwafle wants to merge 10 commits into
jeffvli:developmentfrom
ermmmwafle:navidrome-date

Conversation

@ermmmwafle

Copy link
Copy Markdown

This PR tries to separate for the DATE and RELEASEDATE fields similar to navidrome which uses ~3 fields for dates and years in addition to some other minor changes.

  • DATE/YEAR: The recording date of the track
  • RELEASEDATE: The release date of the album
  • ORIGINALDATE/ORIGINALYEAR: The original release date of the album (nothing done in this PR)

All instances of year/date in feishin originally referred to the releaseyear/releasedate fields on the servers, so all the labels for these have been changed to 'Release Year' and 'Release Date' for consistency.

This is a list of things I added (or tried to add) to help with reviewing (Note that most of these changes only really apply to navidrome since to my knowledge jellyfin and subsonic don't have an equivalent to the navidrome track date.)

  • new 'date' and 'year' fields for Songs. Uses 'releaseyear' as a final fallback if theres no track date/year.
  • added date/year fields for fullscreen player, columns on the table, grid, and detail displays for songs, and as client side song filters.
  • Added 'year' sort option for songs.
  • Song info now shows date and release date with their respective year fields as backups instead of just showing the release year.
image
  • date/release date column views now show the full date in english format (e.g. "Oct 12, 2023") instead of just showing the year.
  • added the track year range for albums with tracks that span over multiple years from the navidrome ui.
image
  • Tried to add the settings version migration to properly add the fields when upgrading, but the version # might need to be changed.

Please let me know about any changes/fixes I should make!

…ays respective year field if no date present

added releaseYear player filter
Made fullscreen player show formatted date
fixed minor year/release year value mismatches
added subsonic date/year field to enable the fields in folder view for navidrome using subsonic year field
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
feishin Ready Ready Preview Jul 31, 2026 4:58am

Comment on lines +96 to +133
const normalizeTrackYearRange = (
songs: z.infer<typeof ndType._response.songList>,
): null | { max: number; min: number } => {
if (!songs || songs.length === 0) {
return null;
}

let minYear = Number.MAX_SAFE_INTEGER;
let maxYear = Number.MIN_SAFE_INTEGER;

for (const song of songs) {
const fromSongDate = parsePartialIsoDate(song.date);
const songApiYear = coerceYear(song.year);
const year =
fromSongDate.year > 0 ? fromSongDate.year : songApiYear > 0 ? songApiYear : null;

if (!year) continue;

if (year < minYear) {
minYear = year;
}

if (year > maxYear) {
maxYear = year;
}
}

if (minYear === Number.MAX_SAFE_INTEGER || maxYear === Number.MIN_SAFE_INTEGER) {
return null;
}

if (minYear === maxYear) {
return null;
}

return { max: maxYear, min: minYear };
};

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.

Is there a specific reason you're using a separate function for this? Navidrome's album domain type already returns minYear and maxYear so this probably isn't needed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Nope. I saw those but completely forgot to check them before the PR! I'll push a commit to fix that in a minute

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