feat: add head/tail/line range options to content endpoints
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -282,13 +282,32 @@ impl AsyncItemService {
|
||||
pub async fn get_item_content_info_streaming(
|
||||
&self,
|
||||
item_id: i64,
|
||||
head_bytes: Option<usize>,
|
||||
head_words: Option<usize>,
|
||||
head_lines: Option<usize>,
|
||||
tail_bytes: Option<usize>,
|
||||
tail_words: Option<usize>,
|
||||
tail_lines: Option<usize>,
|
||||
line_start: Option<usize>,
|
||||
line_end: Option<usize>,
|
||||
) -> Result<(Box<dyn Read + Send>, 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_streaming(&conn, item_id)
|
||||
item_service.get_item_content_info_streaming(
|
||||
&conn,
|
||||
item_id,
|
||||
head_bytes,
|
||||
head_words,
|
||||
head_lines,
|
||||
tail_bytes,
|
||||
tail_words,
|
||||
tail_lines,
|
||||
line_start,
|
||||
line_end
|
||||
)
|
||||
})
|
||||
.await
|
||||
.unwrap()
|
||||
|
||||
Reference in New Issue
Block a user