mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-05 22:55:58 +00:00
Fix mimetype extractors
This commit is contained in:
parent
74fb0d994f
commit
aed5dfaff6
@ -99,7 +99,7 @@ object Conversion {
|
|||||||
val all = Set(MimeType.jpeg, MimeType.png, MimeType.tiff)
|
val all = Set(MimeType.jpeg, MimeType.png, MimeType.tiff)
|
||||||
|
|
||||||
def unapply(m: MimeType): Option[MimeType] =
|
def unapply(m: MimeType): Option[MimeType] =
|
||||||
Some(m).filter(all.contains)
|
Some(m).map(_.baseType).filter(all.contains)
|
||||||
}
|
}
|
||||||
|
|
||||||
object Texts {
|
object Texts {
|
||||||
@ -148,7 +148,7 @@ object Conversion {
|
|||||||
)
|
)
|
||||||
|
|
||||||
def unapply(m: MimeType): Option[MimeType] =
|
def unapply(m: MimeType): Option[MimeType] =
|
||||||
Some(m).filter(all.contains)
|
Some(m).map(_.baseType).filter(all.contains)
|
||||||
}
|
}
|
||||||
|
|
||||||
def unapply(mt: MimeType): Option[MimeType] =
|
def unapply(mt: MimeType): Option[MimeType] =
|
||||||
@ -156,7 +156,6 @@ object Conversion {
|
|||||||
case Office(_) => Some(mt)
|
case Office(_) => Some(mt)
|
||||||
case Texts(_) => Some(mt)
|
case Texts(_) => Some(mt)
|
||||||
case Images(_) => Some(mt)
|
case Images(_) => Some(mt)
|
||||||
case MimeType.html => Some(mt)
|
|
||||||
case _ => None
|
case _ => None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user