mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-09-08 17:09:14 +08:00
fix: 修复提前 break 的逻辑错误
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ pub async fn process_favorite(
|
|||||||
pin_mut!(video_stream);
|
pin_mut!(video_stream);
|
||||||
while let Some(videos_info) = video_stream.next().await {
|
while let Some(videos_info) = video_stream.next().await {
|
||||||
let exist_bvids_pubtimes =
|
let exist_bvids_pubtimes =
|
||||||
exists_bvids_favtime(&videos_info, fid, connection.as_ref()).await?;
|
exists_bvids_favtime(&videos_info, favorite_obj.id, connection.as_ref()).await?;
|
||||||
let should_break = videos_info
|
let should_break = videos_info
|
||||||
.iter()
|
.iter()
|
||||||
// 出现 bvid 和 fav_time 都相同的记录,说明已经到达了上次处理到的位置
|
// 出现 bvid 和 fav_time 都相同的记录,说明已经到达了上次处理到的位置
|
||||||
|
|||||||
+3
-1
@@ -58,10 +58,10 @@ pub async fn exists_bvids_favtime(
|
|||||||
)
|
)
|
||||||
.select_only()
|
.select_only()
|
||||||
.columns([video::Column::Bvid, video::Column::Favtime])
|
.columns([video::Column::Bvid, video::Column::Favtime])
|
||||||
|
.into_tuple()
|
||||||
.all(connection)
|
.all(connection)
|
||||||
.await?
|
.await?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|v| (v.bvid, v.favtime))
|
|
||||||
.collect::<HashSet<(String, DateTime)>>();
|
.collect::<HashSet<(String, DateTime)>>();
|
||||||
Ok(exist_bvid_favtime)
|
Ok(exist_bvid_favtime)
|
||||||
}
|
}
|
||||||
@@ -104,6 +104,7 @@ pub async fn create_videos(
|
|||||||
.do_nothing()
|
.do_nothing()
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
)
|
)
|
||||||
|
.do_nothing()
|
||||||
.exec(connection)
|
.exec(connection)
|
||||||
.await?;
|
.await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -166,6 +167,7 @@ pub async fn create_video_pages(
|
|||||||
.do_nothing()
|
.do_nothing()
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
)
|
)
|
||||||
|
.do_nothing()
|
||||||
.exec(connection)
|
.exec(connection)
|
||||||
.await?;
|
.await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user