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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user