epoupon / lms

Lightweight Music Server. Access your self-hosted music using a web interface.
http://lms-demo.poupon.dev
GNU General Public License v3.0
1.03k stars 60 forks source link

OS API returns only year for incomplete original release dates #477

Open splintering opened 1 month ago

splintering commented 1 month ago

The field "originalReleaseDate" in the AlbumID3 set of the OS API contains an array with "year", "month" and "day" entries.

If the coresponding tag does not contain a full calendar date (YYYY-MM-DD), but a partial date (e.g. YYYY-MM), or an invalid date (e.g. YYYY-MM-00), then LMS will only return the year. I would expect that at least in the case of YYYY-MM, year and month are returned. As a courtesy, the same could be done for YYYY-MM-00, as the 00 indicates that no specific day of the month is meant.

Examples of what is currently being sent: Date in tag -> sent by LMS via OS API 1955-02-01 -> "originalReleaseDate":{"day":1,"month":2,"year":1955} 1955-02-00 -> "originalReleaseDate":{"year":1955} 1955-02 -> "originalReleaseDate":{"year":1955} I think the latter two cases should sent "originalReleaseDate":{"month":2,"year":1955}

epoupon commented 1 month ago

Hello! Indeed, LMS stores a year and possibly a full date (year+month+day), this requires some changes in the parser and the database schema.