summaryrefslogtreecommitdiff
path: root/internal/media/refetch.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-08-03 17:05:38 +0000
committerLibravatar GitHub <noreply@github.com>2024-08-03 19:05:38 +0200
commitb85a9983d09a177648c9db1dff53ffccb3cef777 (patch)
treeacdef8a405d22901cb77665da4dc54af33b4db11 /internal/media/refetch.go
parent[chore] Add `media-ffmpeg-pool-size` config var (#3164) (diff)
downloadgotosocial-b85a9983d09a177648c9db1dff53ffccb3cef777.tar.xz
[bugfix] fix emoji recaching operations (#3167)
* add test for emoji update image * update emoji recache to set the instance account id * don't refresh emoji if only not cached. in that case literally just recache * code comment * rename + move a few things * add some more code comments, and rename some functions to make logic a bit clearer * remove unnecessary nil check (the value can be nil) * comment wording * remove test data output * handle the case of caching an emoji which has been refreshed then uncached * allow overwriting on testrig storage as we do now on regular storage * fix emoji category ID not getting updated --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'internal/media/refetch.go')
-rw-r--r--internal/media/refetch.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/media/refetch.go b/internal/media/refetch.go
index e5b91d56f..5531f6d97 100644
--- a/internal/media/refetch.go
+++ b/internal/media/refetch.go
@@ -115,7 +115,7 @@ func (m *Manager) RefetchEmojis(ctx context.Context, domain string, dereferenceM
return dereferenceMedia(ctx, emojiImageIRI, int64(maxsz))
}
- processingEmoji, err := m.RefreshEmoji(ctx, emoji, dataFunc, AdditionalEmojiInfo{
+ processingEmoji, err := m.UpdateEmoji(ctx, emoji, dataFunc, AdditionalEmojiInfo{
Domain: &emoji.Domain,
ImageRemoteURL: &emoji.ImageRemoteURL,
ImageStaticRemoteURL: &emoji.ImageStaticRemoteURL,
@@ -123,16 +123,16 @@ func (m *Manager) RefetchEmojis(ctx context.Context, domain string, dereferenceM
VisibleInPicker: emoji.VisibleInPicker,
})
if err != nil {
- log.Errorf(ctx, "emoji %s could not be refreshed because of an error during processing: %s", shortcodeDomain, err)
+ log.Errorf(ctx, "emoji %s could not be updated because of an error during processing: %s", shortcodeDomain, err)
continue
}
if _, err := processingEmoji.Load(ctx); err != nil {
- log.Errorf(ctx, "emoji %s could not be refreshed because of an error during loading: %s", shortcodeDomain, err)
+ log.Errorf(ctx, "emoji %s could not be updated because of an error during loading: %s", shortcodeDomain, err)
continue
}
- log.Tracef(ctx, "refetched emoji %s successfully from remote", shortcodeDomain)
+ log.Tracef(ctx, "refetched + updated emoji %s successfully from remote", shortcodeDomain)
totalRefetched++
}