Closed gal20 closed 3 years ago
Hi. Thanks for your PR. I think it's good to go.
Looking at the Album attributes got me thinking. The album dict already has a release_date
key alongside the release_date_components
. I don't know why I chose to use release_date_components
instead because release_date
is just what we need for converting the release date to a datetime type. We should've used release_date
for three reasons:
release_date_components
has the accurate date; if the release date has no month or day, its value will just be None. But that's not the case for release_date
. The release_date
value will display what it has and replaces what it doesn't with 01
, just how Python does in datetime objects!release_date
to datetime to offer a convenient way for accessing the date. And we should keep release_date_compnents
as it is for users who want an accurate date.release_date
to datetime is easy; it's either None
or a string with the %Y-%m-%d
format.I'm not familiar with the internals of this module, I simply got this exception and applied a quick fix. Feel free to close this PR if you intend to drastically alter or remove this function.
Don't mind that comment. It's just meant for the developers. Your PR is good to go and it'll probably be merged soon.
Tested with Hadestown (2010). On master, I get the following exception:
The error is caused by this line:
date = int(year)
whendate
should be a string.I've fixed this issue and simplified the function a bit.