summaryrefslogtreecommitdiff
path: root/internal/processing/media
diff options
context:
space:
mode:
Diffstat (limited to 'internal/processing/media')
-rw-r--r--internal/processing/media/create.go2
-rw-r--r--internal/processing/media/getemoji.go2
-rw-r--r--internal/processing/media/getmedia.go2
-rw-r--r--internal/processing/media/media.go6
-rw-r--r--internal/processing/media/media_test.go4
-rw-r--r--internal/processing/media/unattach.go2
-rw-r--r--internal/processing/media/update.go2
7 files changed, 10 insertions, 10 deletions
diff --git a/internal/processing/media/create.go b/internal/processing/media/create.go
index cdc65dfa4..b8c469dde 100644
--- a/internal/processing/media/create.go
+++ b/internal/processing/media/create.go
@@ -56,7 +56,7 @@ func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, form
return nil, gtserror.NewErrorUnprocessableEntity(err)
}
- apiAttachment, err := p.tc.AttachmentToAPIAttachment(ctx, attachment)
+ apiAttachment, err := p.converter.AttachmentToAPIAttachment(ctx, attachment)
if err != nil {
err := fmt.Errorf("error parsing media attachment to frontend type: %s", err)
return nil, gtserror.NewErrorInternalError(err)
diff --git a/internal/processing/media/getemoji.go b/internal/processing/media/getemoji.go
index aef3482ae..06712756a 100644
--- a/internal/processing/media/getemoji.go
+++ b/internal/processing/media/getemoji.go
@@ -39,7 +39,7 @@ func (p *Processor) GetCustomEmojis(ctx context.Context) ([]*apimodel.Emoji, gts
apiEmojis := make([]*apimodel.Emoji, 0, len(emojis))
for _, gtsEmoji := range emojis {
- apiEmoji, err := p.tc.EmojiToAPIEmoji(ctx, gtsEmoji)
+ apiEmoji, err := p.converter.EmojiToAPIEmoji(ctx, gtsEmoji)
if err != nil {
log.Errorf(ctx, "error converting emoji with id %s: %s", gtsEmoji.ID, err)
continue
diff --git a/internal/processing/media/getmedia.go b/internal/processing/media/getmedia.go
index e815e8bcf..8f5b9d740 100644
--- a/internal/processing/media/getmedia.go
+++ b/internal/processing/media/getmedia.go
@@ -42,7 +42,7 @@ func (p *Processor) Get(ctx context.Context, account *gtsmodel.Account, mediaAtt
return nil, gtserror.NewErrorNotFound(errors.New("attachment not owned by requesting account"))
}
- a, err := p.tc.AttachmentToAPIAttachment(ctx, attachment)
+ a, err := p.converter.AttachmentToAPIAttachment(ctx, attachment)
if err != nil {
return nil, gtserror.NewErrorNotFound(fmt.Errorf("error converting attachment: %s", err))
}
diff --git a/internal/processing/media/media.go b/internal/processing/media/media.go
index cec912874..22c455920 100644
--- a/internal/processing/media/media.go
+++ b/internal/processing/media/media.go
@@ -26,16 +26,16 @@ import (
type Processor struct {
state *state.State
- tc typeutils.TypeConverter
+ converter *typeutils.Converter
mediaManager *media.Manager
transportController transport.Controller
}
// New returns a new media processor.
-func New(state *state.State, tc typeutils.TypeConverter, mediaManager *media.Manager, transportController transport.Controller) Processor {
+func New(state *state.State, converter *typeutils.Converter, mediaManager *media.Manager, transportController transport.Controller) Processor {
return Processor{
state: state,
- tc: tc,
+ converter: converter,
mediaManager: mediaManager,
transportController: transportController,
}
diff --git a/internal/processing/media/media_test.go b/internal/processing/media/media_test.go
index 97e490a9c..523428140 100644
--- a/internal/processing/media/media_test.go
+++ b/internal/processing/media/media_test.go
@@ -34,7 +34,7 @@ type MediaStandardTestSuite struct {
// standard suite interfaces
suite.Suite
db db.DB
- tc typeutils.TypeConverter
+ tc *typeutils.Converter
storage *storage.Driver
state state.State
mediaManager *media.Manager
@@ -73,7 +73,7 @@ func (suite *MediaStandardTestSuite) SetupTest() {
suite.db = testrig.NewTestDB(&suite.state)
suite.state.DB = suite.db
- suite.tc = testrig.NewTestTypeConverter(suite.db)
+ suite.tc = typeutils.NewConverter(&suite.state)
suite.storage = testrig.NewInMemoryStorage()
suite.state.Storage = suite.storage
suite.mediaManager = testrig.NewTestMediaManager(&suite.state)
diff --git a/internal/processing/media/unattach.go b/internal/processing/media/unattach.go
index c6eeac604..ddf2dda20 100644
--- a/internal/processing/media/unattach.go
+++ b/internal/processing/media/unattach.go
@@ -49,7 +49,7 @@ func (p *Processor) Unattach(ctx context.Context, account *gtsmodel.Account, med
return nil, gtserror.NewErrorNotFound(fmt.Errorf("db error updating attachment: %s", err))
}
- a, err := p.tc.AttachmentToAPIAttachment(ctx, attachment)
+ a, err := p.converter.AttachmentToAPIAttachment(ctx, attachment)
if err != nil {
return nil, gtserror.NewErrorNotFound(fmt.Errorf("error converting attachment: %s", err))
}
diff --git a/internal/processing/media/update.go b/internal/processing/media/update.go
index 59ade9ca5..d3a9cfe61 100644
--- a/internal/processing/media/update.go
+++ b/internal/processing/media/update.go
@@ -65,7 +65,7 @@ func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, media
return nil, gtserror.NewErrorInternalError(fmt.Errorf("database error updating media: %s", err))
}
- a, err := p.tc.AttachmentToAPIAttachment(ctx, attachment)
+ a, err := p.converter.AttachmentToAPIAttachment(ctx, attachment)
if err != nil {
return nil, gtserror.NewErrorNotFound(fmt.Errorf("error converting attachment: %s", err))
}