Skip to main content

ncm_api_rs/api/
top_playlist_highquality.rs

1use super::Query;
2use crate::error::Result;
3/// 精品歌单
4/// 对应 Node.js module/top_playlist_highquality.js
5use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9    /// 精品歌单
10    /// 对应 /top/playlist/highquality
11    pub async fn top_playlist_highquality(&self, query: &Query) -> Result<ApiResponse> {
12        let data = json!({
13            "cat": query.get_or("cat", "全部"),
14            "limit": query.get_or("limit", "50").parse::<i64>().unwrap_or(50),
15            "lasttime": query.get_or("before", "0").parse::<i64>().unwrap_or(0),
16            "total": true
17        });
18        self.request(
19            "/api/playlist/highquality/list",
20            data,
21            query.to_option(CryptoType::Weapi),
22        )
23        .await
24    }
25}