Skip to content

Commit

Permalink
fix crtiticl feed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
freedit-dev committed Oct 14, 2024
1 parent 394f850 commit b19ab25
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/controller/feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ pub(super) async fn update(
let item_id;
if let Some(v) = item_links_tree.get(&source_item.link)? {
item_id = ivec_to_u32(&v);
let item: Item = get_one(db, "items", item_id)?;
item_ids.push((item_id, item.updated));
} else {
item_id = incr_id(db, "items_count")?;
let item = Item {
Expand All @@ -638,9 +640,8 @@ pub(super) async fn update(
item_links_tree.insert(&item.link, u32_to_ivec(item_id))?;
set_one(db, "items", item_id, &item)?;
tan_tree.insert(format!("item{}", item_id), &[])?;
item_ids.push((item_id, source_item.updated));
};

item_ids.push((item_id, source_item.updated));
}

Feed {
Expand All @@ -655,6 +656,8 @@ pub(super) async fn update(
let item_id;
if let Some(v) = item_links_tree.get(&source_item.link)? {
item_id = ivec_to_u32(&v);
let item: Item = get_one(db, "items", item_id)?;
item_ids.push((item_id, item.updated));
} else {
item_id = incr_id(db, "items_count")?;
let item = Item {
Expand All @@ -667,9 +670,8 @@ pub(super) async fn update(
item_links_tree.insert(&item.link, u32_to_ivec(item_id))?;
set_one(db, "items", item_id, &item)?;
tan_tree.insert(format!("item{}", item_id), &[])?;
item_ids.push((item_id, source_item.updated));
};

item_ids.push((item_id, source_item.updated));
}

Feed {
Expand Down

0 comments on commit b19ab25

Please sign in to comment.