Skip to main content

ncm_api_rs/api/
top_mv.rs

1use super::Query;
2use crate::error::Result;
3/// MV 排行榜
4/// 对应 Node.js module/top_mv.js
5use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9    /// MV 排行榜
10    /// 对应 /top/mv
11    pub async fn top_mv(&self, query: &Query) -> Result<ApiResponse> {
12        let data = json!({
13            "area": query.get_or("area", ""),
14            "limit": query.get_or("limit", "30").parse::<i64>().unwrap_or(30),
15            "offset": query.get_or("offset", "0").parse::<i64>().unwrap_or(0),
16            "total": true
17        });
18        self.request("/api/mv/toplist", data, query.to_option(CryptoType::Weapi))
19            .await
20    }
21}