Fix, placeholder image, api
Added a placeholder image, code style Fixed metadata missing issue More work on api
This commit is contained in:
parent
529d106351
commit
0e036b152b
8 changed files with 192 additions and 94 deletions
|
@ -23,9 +23,22 @@ func convertAccountStorageToLinstrom(
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("icon: %w", err)
|
||||
}
|
||||
storageBanner, err := store.GetMediaMetadataById(acc.Banner)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("banner: %w", err)
|
||||
var apiBanner *linstromMediaMetadata
|
||||
if acc.Banner != nil {
|
||||
storageBanner, err := store.GetMediaMetadataById(*acc.Banner)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("banner: %w", err)
|
||||
}
|
||||
apiBanner = convertMediaMetadataStorageToLinstrom(storageBanner)
|
||||
}
|
||||
|
||||
var apiBackground *linstromMediaMetadata
|
||||
if acc.Background != nil {
|
||||
storageBackground, err := store.GetMediaMetadataById(*acc.Background)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("banner: %w", err)
|
||||
}
|
||||
apiBackground = convertMediaMetadataStorageToLinstrom(storageBackground)
|
||||
}
|
||||
storageFields, err := store.FindMultipleUserFieldsById(acc.CustomFields)
|
||||
if err != nil {
|
||||
|
@ -50,7 +63,11 @@ func convertAccountStorageToLinstrom(
|
|||
IsBot: acc.IsBot,
|
||||
Description: acc.Description,
|
||||
Icon: convertMediaMetadataStorageToLinstrom(storageIcon),
|
||||
Banner: convertMediaMetadataStorageToLinstrom(storageBanner),
|
||||
IconId: acc.Icon,
|
||||
Banner: apiBanner,
|
||||
BannerId: acc.Banner,
|
||||
Background: apiBackground,
|
||||
BackgroundId: acc.Background,
|
||||
FollowerIds: acc.Followers,
|
||||
FollowingIds: acc.Follows,
|
||||
Indexable: acc.Indexable,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue