refactor: Consolidate item content filtering into a single filter string
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -68,15 +68,7 @@ impl AsyncItemService {
|
||||
pub async fn get_item_content_info(
|
||||
&self,
|
||||
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>,
|
||||
grep: Option<String>,
|
||||
filter: Option<String>,
|
||||
) -> Result<(Vec<u8>, String, bool), CoreError> {
|
||||
let db = self.db.clone();
|
||||
let item_service = self.item_service.clone();
|
||||
@@ -86,15 +78,7 @@ impl AsyncItemService {
|
||||
item_service.get_item_content_info(
|
||||
&conn,
|
||||
id,
|
||||
head_bytes,
|
||||
head_words,
|
||||
head_lines,
|
||||
tail_bytes,
|
||||
tail_words,
|
||||
tail_lines,
|
||||
line_start,
|
||||
line_end,
|
||||
grep
|
||||
filter
|
||||
)
|
||||
})
|
||||
.await
|
||||
@@ -182,15 +166,7 @@ impl AsyncItemService {
|
||||
allow_binary: bool,
|
||||
offset: u64,
|
||||
length: u64,
|
||||
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>,
|
||||
grep: Option<String>,
|
||||
filter: Option<String>,
|
||||
) -> Result<(std::pin::Pin<Box<dyn tokio_stream::Stream<Item = Result<tokio_util::bytes::Bytes, std::io::Error>> + Send>>, String), CoreError> {
|
||||
// Use provided metadata to determine MIME type and binary status
|
||||
let mime_type = metadata
|
||||
@@ -225,7 +201,7 @@ impl AsyncItemService {
|
||||
item_service.get_item_content_info_streaming(
|
||||
&conn,
|
||||
item_id,
|
||||
None
|
||||
filter
|
||||
).map(|(reader, _, _)| reader)
|
||||
})
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user