Closed codello closed 4 years ago
Hey, Thanks for the review. I replied to your comment but I noticed some other issues with the PR, so here's an update:
pycountry
to convert between country codes.MusicAlbum
.ResultItem
now has a get_country()
method for converting between country code formats via pycountry.While working on this I noticed that itunespy
currently does not include type annotations. I could create another pull request adding type hints. This would however break compatibility with Python 3.4 (which has reached its EOL anyway). What do you think?
Okay, this looks perfect! Also love the idea of adding type annotations, so feel free to create another PR with that. I'll merge this and once the PR with the type annotations is ready I'll create another version of the library and publish it. Thank you so much for the contribution! 😃
When searching the iTunes API it is possible to specify a
country
. This way one might get aMusicAlgum
from the_get_result_list
method. Using theget_tracks
method on such an album willlookup
the album. This however does not retain the country that was initially specified. For albums that are not available on the default (US) iTunes Store this causesget_tracks
to effectively fail (no results are returned).This pull request adds the
country
field toResultItem
and retains thecountry
from a search or lookup operation in the respective results. It also modifies theget_tracks
method to lookup tracks in the samecountry
that theMusicAlbum
belongs to.