From 5faeb4de2032e112ab49751eeeb906ac43826f3d Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Sun, 28 May 2023 13:08:35 +0100 Subject: [chore] tidy up media manager, add calling func to errors, build-script improvements (#1835) * media manager tidy-up: de-interface and remove unused PostDataFunc Signed-off-by: kim * remove last traces of media.Manager being an interface Signed-off-by: kim * update error to provide caller, allow tuneable via build tags Signed-off-by: kim * remove kim-specific build script changes Signed-off-by: kim * fix merge conflicts Signed-off-by: kim * update build-script to support externally setting build variables Signed-off-by: kim --------- Signed-off-by: kim --- internal/processing/admin/admin.go | 4 ++-- internal/processing/admin/emoji.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/processing/admin') diff --git a/internal/processing/admin/admin.go b/internal/processing/admin/admin.go index ad0279dbf..9b243e06d 100644 --- a/internal/processing/admin/admin.go +++ b/internal/processing/admin/admin.go @@ -28,13 +28,13 @@ import ( type Processor struct { state *state.State tc typeutils.TypeConverter - mediaManager media.Manager + mediaManager *media.Manager transportController transport.Controller emailSender email.Sender } // New returns a new admin processor. -func New(state *state.State, tc typeutils.TypeConverter, mediaManager media.Manager, transportController transport.Controller, emailSender email.Sender) Processor { +func New(state *state.State, tc typeutils.TypeConverter, mediaManager *media.Manager, transportController transport.Controller, emailSender email.Sender) Processor { return Processor{ state: state, tc: tc, diff --git a/internal/processing/admin/emoji.go b/internal/processing/admin/emoji.go index acea85116..3a7868eb1 100644 --- a/internal/processing/admin/emoji.go +++ b/internal/processing/admin/emoji.go @@ -74,7 +74,7 @@ func (p *Processor) EmojiCreate(ctx context.Context, account *gtsmodel.Account, } } - processingEmoji, err := p.mediaManager.PreProcessEmoji(ctx, data, nil, form.Shortcode, emojiID, emojiURI, ai, false) + processingEmoji, err := p.mediaManager.PreProcessEmoji(ctx, data, form.Shortcode, emojiID, emojiURI, ai, false) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error processing emoji: %s", err), "error processing emoji") } @@ -355,7 +355,7 @@ func (p *Processor) emojiUpdateCopy(ctx context.Context, emoji *gtsmodel.Emoji, } } - processingEmoji, err := p.mediaManager.PreProcessEmoji(ctx, data, nil, *shortcode, newEmojiID, newEmojiURI, ai, false) + processingEmoji, err := p.mediaManager.PreProcessEmoji(ctx, data, *shortcode, newEmojiID, newEmojiURI, ai, false) if err != nil { err = fmt.Errorf("emojiUpdateCopy: error processing emoji %s: %s", emoji.ID, err) return nil, gtserror.NewErrorInternalError(err) @@ -461,7 +461,7 @@ func (p *Processor) emojiUpdateModify(ctx context.Context, emoji *gtsmodel.Emoji } } - processingEmoji, err := p.mediaManager.PreProcessEmoji(ctx, data, nil, emoji.Shortcode, emoji.ID, emoji.URI, ai, true) + processingEmoji, err := p.mediaManager.PreProcessEmoji(ctx, data, emoji.Shortcode, emoji.ID, emoji.URI, ai, true) if err != nil { err = fmt.Errorf("emojiUpdateModify: error processing emoji %s: %s", emoji.ID, err) return nil, gtserror.NewErrorInternalError(err) -- cgit v1.2.3