diff --git a/entity/src/entities/favorite.rs b/entity/src/entities/favorite.rs index d6e0666..1654598 100644 --- a/entity/src/entities/favorite.rs +++ b/entity/src/entities/favorite.rs @@ -8,7 +8,7 @@ pub struct Model { #[sea_orm(primary_key)] pub id: i32, #[sea_orm(unique)] - pub f_id: i32, + pub f_id: i64, pub name: String, pub path: String, pub created_at: String, diff --git a/entity/src/entities/video.rs b/entity/src/entities/video.rs index 3b9d57b..47ca29f 100644 --- a/entity/src/entities/video.rs +++ b/entity/src/entities/video.rs @@ -8,7 +8,7 @@ pub struct Model { #[sea_orm(primary_key)] pub id: i32, pub favorite_id: i32, - pub upper_id: i32, + pub upper_id: i64, pub upper_name: String, pub upper_face: String, pub name: String, diff --git a/src/bilibili/favorite_list.rs b/src/bilibili/favorite_list.rs index 12e840a..dd69f44 100644 --- a/src/bilibili/favorite_list.rs +++ b/src/bilibili/favorite_list.rs @@ -15,7 +15,7 @@ pub struct FavoriteList<'a> { #[derive(Debug, serde::Deserialize)] pub struct FavoriteListInfo { - pub id: i32, + pub id: i64, pub title: String, } @@ -39,7 +39,7 @@ pub struct VideoInfo { #[derive(Debug, serde::Deserialize)] pub struct Upper { - pub mid: i32, + pub mid: i64, pub name: String, pub face: String, } @@ -103,14 +103,18 @@ impl<'a> FavoriteList<'a> { let mut videos = match self.get_videos(page).await { Ok(v) => v, Err(e) => { - error!("failed to get videos of page {}: {}", page, e); + error!("failed to get videos of favorite {} page {}: {}", self.fid, page, e); break; }, }; + if !videos["data"]["medias"].is_array() { + error!("no medias found in favorite {} page {}", self.fid, page); + break; + } let videos_info = match serde_json::from_value::>(videos["data"]["medias"].take()) { Ok(v) => v, Err(e) => { - error!("failed to parse videos of page {}: {}", page, e); + error!("failed to parse videos of favorite {} page {}: {}", self.fid, page, e); break; }, };