Filter by mime
This commit is contained in:
@@ -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))?,
|
||||
)),
|
||||
|
||||
Reference in New Issue
Block a user