summaryrefslogtreecommitdiff
path: root/rhimport/core.go
diff options
context:
space:
mode:
Diffstat (limited to 'rhimport/core.go')
-rw-r--r--rhimport/core.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/rhimport/core.go b/rhimport/core.go
index 9780485..f1bbe16 100644
--- a/rhimport/core.go
+++ b/rhimport/core.go
@@ -126,6 +126,11 @@ func getCBAApiKey() string {
return ""
}
+type AttachmentChunk struct {
+ Data []byte
+ Error error
+}
+
type Context struct {
conf *Config
db *rddb.DBChan
@@ -144,7 +149,7 @@ type Context struct {
AutotrimLevel int
UseMetaData bool
SourceUri string
- AttachmentChan <-chan []byte
+ AttachmentChan chan AttachmentChunk
FetchConverter string
OrigFilename string
Title string
@@ -175,7 +180,7 @@ func NewContext(conf *Config, db *rddb.DBChan) *Context {
ctx.NormalizationLevel = conf.ImportParamDefaults.NormalizationLevel
ctx.AutotrimLevel = conf.ImportParamDefaults.AutotrimLevel
ctx.UseMetaData = conf.ImportParamDefaults.UseMetaData
- ctx.AttachmentChan = nil
+ ctx.AttachmentChan = make(chan AttachmentChunk, 32)
ctx.FetchConverter = "ffmpeg-bs1770"
ctx.OrigFilename = ""
ctx.Title = ""