1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use crate::{
    models::system::{PublicSystemInformations, SystemEndpointStatus, SystemInformations},
    JellyfinAPI, JellyfinResponse, JellyfinSDKResult,
};

use super::URLBuilder;

impl JellyfinAPI {
    #[cfg(feature = "sync")]
    pub fn get_endpoint_informations() {}

    /// Gets information about the request endpoint.
    pub async fn async_get_endpoint_informations(
        &self,
    ) -> JellyfinSDKResult<JellyfinResponse<SystemEndpointStatus>> {
        let url = URLBuilder::from(self.base_addr(), "/System/Endpoint")?;

        let res = self.async_client().get(url.build()).send().await?;

        JellyfinResponse::async_from(res).await
    }

    #[cfg(feature = "sync")]
    pub fn get_system_informations() {}

    /// Gets information about the server.
    pub async fn async_get_system_informations(
        &self,
    ) -> JellyfinSDKResult<JellyfinResponse<SystemInformations>> {
        let url = URLBuilder::from(self.base_addr(), "/System/Info")?;

        let res = self.async_client().get(url.build()).send().await?;

        JellyfinResponse::async_from(res).await
    }

    #[cfg(feature = "sync")]
    pub fn get_public_system_informations() {}

    /// Gets public information about the server.
    pub async fn async_get_public_system_informations(
        &self,
    ) -> JellyfinSDKResult<JellyfinResponse<PublicSystemInformations>> {
        let url = URLBuilder::from(self.base_addr(), "/System/Info/Public")?;

        let res = self.async_client().get(url.build()).send().await?;

        JellyfinResponse::async_from(res).await
    }
}