dhowden / tag

ID3, MP4 and OGG/FLAC metadata parsing in Go
BSD 2-Clause "Simplified" License
558 stars 72 forks source link

Try to parse the year when 'year' tag could be a date #104

Closed JorgeLNJunior closed 5 months ago

JorgeLNJunior commented 7 months ago

When the year/date tag is a date, it can't be parsed into a number, so the Year() method returns a zero value. This PR tries to fix this by checking if the Atoi() function returns 0. If it does, the string is parsed as a date, and the year is returned. If parsing fails, it still returns zero.

dhowden commented 5 months ago

So I completely missed that the build was failing on here! time.DateOnly is go1.20+, will bump the version in go.mod.

dhowden commented 5 months ago

...and I can't fix this it would seem. Can you bump the go.mod to 1.20 as that's the requirement for this?

JorgeLNJunior commented 5 months ago

Done.

JorgeLNJunior commented 5 months ago

I forgot the workflow file, now it should pass.