mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Experiment with addons
Addons allow to execute external programs in some context inside docspell. Currently it is possible to run them after processing files. Addons are provided by URLs to zip files.
This commit is contained in:
@ -13,6 +13,7 @@ import scala.reflect.ClassTag
|
||||
import cats.syntax.all._
|
||||
import fs2.io.file.Path
|
||||
|
||||
import docspell.addons.RunnerType
|
||||
import docspell.common._
|
||||
import docspell.ftspsql.{PgQueryParser, RankNormalization}
|
||||
import docspell.logging.{Level, LogConfig}
|
||||
@ -32,6 +33,17 @@ object Implicits {
|
||||
else super.fieldValue(name)
|
||||
}
|
||||
|
||||
implicit val urlMatcherReader: ConfigReader[UrlMatcher] = {
|
||||
val fromList = ConfigReader[List[String]].emap(reason(UrlMatcher.fromStringList))
|
||||
val fromString = ConfigReader[String].emap(
|
||||
reason(str => UrlMatcher.fromStringList(str.split("[\\s,]+").toList))
|
||||
)
|
||||
fromList.orElse(fromString)
|
||||
}
|
||||
|
||||
implicit val runnerSelectReader: ConfigReader[List[RunnerType]] =
|
||||
ConfigReader[String].emap(reason(RunnerType.fromSeparatedString))
|
||||
|
||||
implicit val accountIdReader: ConfigReader[AccountId] =
|
||||
ConfigReader[String].emap(reason(AccountId.parse))
|
||||
|
||||
|
Reference in New Issue
Block a user