about summary refs log tree commit diff stats
path: root/internal/importer/importer.go
diff options
context:
space:
mode:
authorAlan Pearce2024-05-14 17:24:31 +0200
committerAlan Pearce2024-05-14 17:24:31 +0200
commitdf3b6bfd571c38aa7099838aa43bb3aff0eff2bf (patch)
tree5695d3a1d537b3456c13b60b0bb10a444ad39089 /internal/importer/importer.go
parent5f9c7ef00b1ed56fb1abbade4d5dbc3041acd4fc (diff)
downloadsearchix-df3b6bfd571c38aa7099838aa43bb3aff0eff2bf.tar.lz
searchix-df3b6bfd571c38aa7099838aa43bb3aff0eff2bf.tar.zst
searchix-df3b6bfd571c38aa7099838aa43bb3aff0eff2bf.zip
feat: add DownloadOptions importer (fetches pre-built options.json)
Diffstat (limited to 'internal/importer/importer.go')
-rw-r--r--internal/importer/importer.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/importer/importer.go b/internal/importer/importer.go
index b66b6d3..c50a72b 100644
--- a/internal/importer/importer.go
+++ b/internal/importer/importer.go
@@ -42,6 +42,20 @@ func NewChannelImporter(
 	}
 }
 
+func NewDownloadOptionsImporter(
+	source *config.Source,
+	dataPath string,
+	logger *slog.Logger,
+) *DownloadOptionsImporter {
+	fullpath := path.Join(dataPath, source.Channel)
+
+	return &DownloadOptionsImporter{
+		DataPath: fullpath,
+		Source:   source,
+		Logger:   logger,
+	}
+}
+
 type importConfig struct {
 	Filename string
 	Source   *config.Source