mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-28 21:12:25 -05:00
tests are passing, but there's still much to be done
This commit is contained in:
parent
f61c3ddcf7
commit
dccf21dd87
18 changed files with 259 additions and 170 deletions
|
|
@ -395,20 +395,20 @@ func ExtractAttachment(i Attachmentable) (*gtsmodel.MediaAttachment, error) {
|
|||
attachment.Description = name
|
||||
}
|
||||
|
||||
attachment.Blurhash = ExtractBlurhash(i)
|
||||
|
||||
attachment.Processing = gtsmodel.ProcessingStatusReceived
|
||||
|
||||
return attachment, nil
|
||||
}
|
||||
|
||||
// func extractBlurhash(i withBlurhash) (string, error) {
|
||||
// if i.GetTootBlurhashProperty() == nil {
|
||||
// return "", errors.New("blurhash property was nil")
|
||||
// }
|
||||
// if i.GetTootBlurhashProperty().Get() == "" {
|
||||
// return "", errors.New("empty blurhash string")
|
||||
// }
|
||||
// return i.GetTootBlurhashProperty().Get(), nil
|
||||
// }
|
||||
// ExtractBlurhash extracts the blurhash value (if present) from a WithBlurhash interface.
|
||||
func ExtractBlurhash(i WithBlurhash) string {
|
||||
if i.GetTootBlurhash() == nil {
|
||||
return ""
|
||||
}
|
||||
return i.GetTootBlurhash().Get()
|
||||
}
|
||||
|
||||
// ExtractHashtags returns a slice of tags on the interface.
|
||||
func ExtractHashtags(i WithTag) ([]*gtsmodel.Tag, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue