Expanded date fields - #2276
Open
ermmmwafle wants to merge 10 commits into
Open
Conversation
fixed year view not showing for grid
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jeffvli
reviewed
Jul 31, 2026
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 }; | ||
| }; | ||
|
|
Owner
There was a problem hiding this comment.
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.
Author
There was a problem hiding this comment.
Nope. I saw those but completely forgot to check them before the PR! I'll push a commit to fix that in a minute
…ields already exist for albums
ermmmwafle
force-pushed
the
navidrome-date
branch
from
July 31, 2026 04:53
98a437b to
9ea0e73
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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.)
Please let me know about any changes/fixes I should make!