Filter by mime

This commit is contained in:
2026-03-15 10:20:15 -07:00
parent 8041fc7531
commit 979fbb9b0d
30 changed files with 258 additions and 93 deletions

View File

@@ -8,7 +8,7 @@ mod epub_text;
pub use epub_text::*;
use crate::{
extract::traits::ObjectExtractor,
extract::traits::{ExtractState, ObjectExtractor},
value::{Item, PileValue},
};
@@ -30,13 +30,14 @@ impl EpubExtractor {
impl ObjectExtractor for EpubExtractor {
async fn field(
&self,
state: &ExtractState,
name: &pile_config::Label,
args: Option<&str>,
) -> Result<Option<PileValue>, std::io::Error> {
match (name.as_str(), args) {
("text", args) => Ok(Some(
self.text
.field(name, args)
.field(state, name, args)
.await
.map(|x| x.unwrap_or(PileValue::Null))?,
)),