mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 19:12:25 -05:00
[feature] Start implementing refetch of lost media files via /api/v1/admin/media_refetch (#1221)
* [chore] Move ShortcodeDomain to its own little util func * [feature] Add RefetchEmojis function to media manager * [feature] Expose admin media refresh via admin API * update following review feedback - change/fix log levels - make sure not to try to refetch local emojis - small style refactoring + comments * log on emoji refetch start Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
24b4f9b5d7
commit
5e060d0bcb
13 changed files with 499 additions and 28 deletions
|
|
@ -88,14 +88,10 @@ func (p *processor) EmojisGet(ctx context.Context, account *gtsmodel.Account, us
|
|||
Items: items,
|
||||
Path: "api/v1/admin/custom_emojis",
|
||||
NextMaxIDKey: "max_shortcode_domain",
|
||||
NextMaxIDValue: shortcodeDomain(emojis[count-1]),
|
||||
NextMaxIDValue: util.ShortcodeDomain(emojis[count-1]),
|
||||
PrevMinIDKey: "min_shortcode_domain",
|
||||
PrevMinIDValue: shortcodeDomain(emojis[0]),
|
||||
PrevMinIDValue: util.ShortcodeDomain(emojis[0]),
|
||||
Limit: limit,
|
||||
ExtraQueryParams: []string{filterBuilder.String()},
|
||||
})
|
||||
}
|
||||
|
||||
func shortcodeDomain(emoji *gtsmodel.Emoji) string {
|
||||
return emoji.Shortcode + "@" + emoji.Domain
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue