use crate::{
data::{Info, ResponseType},
Client, Parameter, SubsonicError,
};
impl Client {
/// reference: http://www.subsonic.org/pages/api.jsp#createPodcastChannel
pub async fn create_podcast_channel(
&self,
url: impl Into<String>,
) -> Result<Info, SubsonicError> {
let mut paras = Parameter::new();
paras.push("url", url);
let body = self
.request("createPodcastChannel", Some(paras), None)
.await?;
if let ResponseType::Ping {} = body.data {
Ok(body.info)
} else {
Err(SubsonicError::Submarine(String::from(
"expected type Ping but found wrong type",
)))
}
}
}