ncm_api_rs/api/
artist_songs.rs1use super::Query;
2use crate::error::Result;
3use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9 pub async fn artist_songs(&self, query: &Query) -> Result<ApiResponse> {
12 let data = json!({
13 "id": query.get_or("id", "0"),
14 "private_cloud": "true",
15 "work_type": 1,
16 "order": query.get_or("order", "hot"),
17 "offset": query.get_or("offset", "0").parse::<i64>().unwrap_or(0),
18 "limit": query.get_or("limit", "100").parse::<i64>().unwrap_or(100)
19 });
20 self.request(
21 "/api/v1/artist/songs",
22 data,
23 query.to_option(CryptoType::default()),
24 )
25 .await
26 }
27}