refactor: add get_item_content_info to AsyncItemService and simplify binary checks

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-25 20:48:09 -03:00
parent 04554fe04d
commit 5830601150
2 changed files with 20 additions and 24 deletions

View File

@@ -47,6 +47,18 @@ impl AsyncItemService {
.unwrap()
}
pub async fn get_item_content_info(&self, id: i64) -> Result<(Vec<u8>, String, bool), CoreError> {
let db = self.db.clone();
let item_service = self.item_service.clone();
tokio::task::spawn_blocking(move || {
let conn = db.blocking_lock();
item_service.get_item_content_info(&conn, id)
})
.await
.unwrap()
}
pub async fn stream_item_content_by_id(
&self,