dvcrn / itunes.ex

iTunes search API wrapper in Elixir
2 stars 1 forks source link

Support to other types of media #1

Open fcevado opened 7 years ago

fcevado commented 7 years ago

Do you intend to support other types of media?

dvcrn commented 7 years ago

I only implemented the parts that I am actively using myself, but it should be fairly straight forward to extend it for different types as well. Check here for a starting point

fcevado commented 7 years ago

I've seen the code... I was thinking to organize the code differently:

I would use the Itunes module to implement the calls to the api(as you the code you linked), but I would have the functions search and lookup, to validate the necessary fields for each call. And it would generate the responses already using the structs.

What do you think? If you agree I can make a code to update the current code to this structure and then we proceed with the other media modules.

dvcrn commented 7 years ago

Yeah I agree that I should have used the same names as it would be on the API. This started inside a other project which heavily used song structs which is why I went with Song for example first. When I moved the code into it's own package I didn't change the names.

Have modules to all the media types: Itunes.Music, Itunes.Movie, Itunes.MusicVideo, etc.. to validate the possible fields/attributes for each kind of media

What do you mean with this?

But in any way, please feel free 👍

fcevado commented 7 years ago

What do you mean with this?

According to the Itunes API, there are some attributes exclusive to each media type. I thought of each Module validating it's attributes before sending to the API, so it would never generate an invalid request.

I'll try to do the PR today.