ncm_api_rs/api/
artist_sub.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_sub(&self, query: &Query) -> Result<ApiResponse> {
12 let t = query.get_or("t", "1");
13 let path = if t == "1" { "sub" } else { "unsub" };
14 let id = query.get_or("id", "0");
15 let data = json!({
16 "artistId": id,
17 "artistIds": format!("[{}]", id)
18 });
19 self.request(
20 &format!("/api/artist/{}", path),
21 data,
22 query.to_option(CryptoType::Weapi),
23 )
24 .await
25 }
26}