[PR #11621] Handle exception for unexpected audio file YEAR tag values #12948

Closed
opened 2026-02-07 07:04:36 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/jellyfin/jellyfin/pull/11621

State: closed
Merged: Yes


Log out of range exception instead of throwing (which would abort the user's operation such as playback) when encountering unexpected values in the YEAR tag of audio files.

The code currently passes the entire content of the YEAR tag to the year argument of the System.DateTime constructor, but this fails if the tag value is something like "20180101" which has been reported in the wild. I'm not sure there's anything better to do than simply catch the exception and move on given the number of possible date formats if we want to handle anything besides "YYYY" in that tag.

Changes
Add try/catch block in AudioFileProber.cs

Issues
Fixes #11576

**Original Pull Request:** https://github.com/jellyfin/jellyfin/pull/11621 **State:** closed **Merged:** Yes --- Log out of range exception instead of throwing (which would abort the user's operation such as playback) when encountering unexpected values in the YEAR tag of audio files. The code currently passes the entire content of the YEAR tag to the `year` argument of the `System.DateTime` constructor, but this fails if the tag value is something like "20180101" which has been reported in the wild. I'm not sure there's anything better to do than simply catch the exception and move on given the number of possible date formats if we want to handle anything besides "YYYY" in that tag. **Changes** Add try/catch block in AudioFileProber.cs **Issues** Fixes #11576
OVERLORD added the pull-request label 2026-02-07 07:04:36 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#12948