Skip to main content

ncm_api_rs/api/
cloud_match.rs

1use super::Query;
2use crate::error::Result;
3/// 云盘歌曲匹配
4/// 对应 Node.js module/cloud_match.js
5use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9    /// 云盘歌曲匹配纠正
10    /// 对应 /cloud/match
11    pub async fn cloud_match(&self, query: &Query) -> Result<ApiResponse> {
12        let data = json!({
13            "userId": query.get_or("uid", ""),
14            "songId": query.get_or("sid", ""),
15            "adjustSongId": query.get_or("asid", "")
16        });
17        self.request(
18            "/api/cloud/user/song/match",
19            data,
20            query.to_option(CryptoType::Weapi),
21        )
22        .await
23    }
24}