submarine 0.1.0

A library for connecting with a subsonic server
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{
    data::{Info, ResponseType},
    Client, SubsonicError,
};

impl Client {
    /// reference: http://www.subsonic.org/pages/api.jsp#refreshPodcasts
    pub async fn refresh_podcasts(&self) -> Result<Info, SubsonicError> {
        let body = self.request("refreshPodcasts", None, None).await?;
        if let ResponseType::Ping {} = body.data {
            Ok(body.info)
        } else {
            Err(SubsonicError::Submarine(String::from(
                "expected type Ping but found wrong type",
            )))
        }
    }
}