From 705877d4979a05d70a598b4359e6d528b36557dc Mon Sep 17 00:00:00 2001 From: amtoaer Date: Sat, 23 Mar 2024 00:09:31 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BD=BF=E7=94=A8=20Arc=20=E4=BB=A3?= =?UTF-8?q?=E6=9B=BF=20Rc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bilibili/analyzer.rs | 4 ++-- src/bilibili/favorite_list.rs | 11 ++++++----- src/bilibili/video.rs | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/bilibili/analyzer.rs b/src/bilibili/analyzer.rs index 83cc2a2..1ec461c 100644 --- a/src/bilibili/analyzer.rs +++ b/src/bilibili/analyzer.rs @@ -1,4 +1,4 @@ -use std::rc::Rc; +use std::sync::Arc; use crate::Result; @@ -44,7 +44,7 @@ pub struct FilterOption { pub video_min_quality: VideoQuality, pub audio_max_quality: AudioQuality, pub audio_min_quality: AudioQuality, - pub codecs: Rc>, + pub codecs: Arc>, pub no_dolby_video: bool, pub no_dolby_audio: bool, pub no_hdr: bool, diff --git a/src/bilibili/favorite_list.rs b/src/bilibili/favorite_list.rs index 04c3af1..11d13d2 100644 --- a/src/bilibili/favorite_list.rs +++ b/src/bilibili/favorite_list.rs @@ -1,4 +1,4 @@ -use std::rc::Rc; +use std::sync::Arc; use async_stream::stream; use futures_core::stream::Stream; @@ -7,15 +7,15 @@ use serde_json::Value; use crate::bilibili::BiliClient; use crate::Result; pub struct FavoriteList { - client: Rc, + client: Arc, fid: String, } #[allow(dead_code)] #[derive(Debug, serde::Deserialize)] pub struct FavoriteListInfo { - id: u64, - title: String, + pub id: u64, + pub title: String, } #[derive(Debug, serde::Deserialize)] @@ -29,6 +29,7 @@ pub struct VideoInfo { pub upper: Upper, pub ctime: u64, pub fav_time: u64, + pub pubtime: u64, } #[derive(Debug, serde::Deserialize)] @@ -37,7 +38,7 @@ pub struct Upper { pub name: String, } impl FavoriteList { - pub fn new(client: Rc, fid: String) -> Self { + pub fn new(client: Arc, fid: String) -> Self { Self { client, fid } } diff --git a/src/bilibili/video.rs b/src/bilibili/video.rs index 294af54..bbb5676 100644 --- a/src/bilibili/video.rs +++ b/src/bilibili/video.rs @@ -1,4 +1,4 @@ -use std::rc::Rc; +use std::sync::Arc; use reqwest::Method; @@ -17,7 +17,7 @@ static DATA: &[char] = &[ ]; pub struct Video { - client: Rc, + client: Arc, pub aid: String, pub bvid: String, } @@ -39,7 +39,7 @@ pub struct Page { } impl Video { - pub fn new(client: Rc, bvid: String) -> Self { + pub fn new(client: Arc, bvid: String) -> Self { let aid = bvid_to_aid(&bvid).to_string(); Self { client, aid, bvid } }