Author Topic: Podcast retrieval through the API  (Read 3531 times)

kelsos

  • Sr. Member
  • ****
  • Posts: 302
I am looking into adding support for Podcasts on the remote application, along with the radio support,
and I have been wondering if it possible to retrieve the Podcasts in a way similar to the Radios.

For radios I am using the following:

Code
        var radioStations = new string[] { };
        var success = _api.Library_QueryFilesEx("domain=Radio", ref radioStations);

I did try domain=Podcasts and domain=Podcast just in case but I got no results.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34350
there isnt a way with the v3.0 api.
I can add something for v3.1
I expect you would also need a field so you know which subscription each podcast belongs to and whether an episode has been played or not. Would you also want to have a filter for only retrieving downloaded episodes (otherwise you would potentially end up with thousands of web links).
And do you see the need for a more advanced query mechanism such as a query to get all the subscriptions first (along with the description and unplayed count for each subscription), and then the user selects a specific subscription for which MB returns all the episodes just in that subscription? I guess it all boils down to whether the bandwidth required to retieve everything in one go will be an issue

kelsos

  • Sr. Member
  • ****
  • Posts: 302
Hi Steven

Getting the subscriptions first and the (with the description and count), and afterwards the data for each subscription sounds nice. This is what I actually had in mind. Actually visually the implementation will work this way.

I could also do this on the client side (by simply retrieving/caching everything), bandwidth should not be an issue since this should probably happen over a WiFi connection.

Whatever is easier for you.




Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34350
the latest v3.1 now has API support for podcasts:
http://musicbee.niblseed.com/V3_1/MusicBee31_Patched.zip

the api interface definition files:
http://www.mediafire.com/file/1cio56q16btp5p7/C%23_Source3.1.zip
http://www.mediafire.com/file/v9207ekc5h8xojx/VB_Source3.1.zip

the api functions
bool Podcasts_QuerySubscriptions(string query, out string[] ids)
retrieves all subscriptions - query is currently ignored

bool Podcasts_GetSubscription(string id, out string[] subscription)
retrieve a single subscription - see SubscriptionMetaDataType for the meaning of the returned subscription data strings

bool Podcasts_GetSubscriptionArtwork(string id, int index, out byte[] imageData)
retrieve artwork for a subscription - only index 0 is has artwork. The data bytes is the raw jpeg/png data

bool Podcasts_GetSubscriptionEpisodes(string id, out string[] urls)
retrives the episode urls in a subscription

bool Podcasts_GetSubscriptionEpisode(string id, int index, out string[] episode)
returns the episode data for a subscription and returns false once index is too large or use the urls.length from the above api call. See EpisodeMetaDataType for the meaning of the episode data strings. You can also use an episode url to query more specific tag data via Library_GetFileTag or Library_GetFileProperty


note i changed the api definitions to use out instead of ref
Last Edit: April 23, 2017, 11:39:08 AM by Steven