feat: always include community image in community collectibles

This commit is contained in:
Dario Gabriel Lipicar 2023-12-15 17:30:00 -03:00 committed by dlipicar
parent b3cc73aa7f
commit 9dea2e8875
2 changed files with 7 additions and 24 deletions

View File

@ -419,8 +419,8 @@ func (s *Service) fullCollectiblesDataToHeaders(data []thirdparty.FullCollectibl
return nil, err
}
communityHeader := communityInfoToHeader(c.CollectibleData.CommunityID, communityInfo, c.CommunityInfo)
header.CommunityData = &communityHeader
communityData := communityInfoToData(c.CollectibleData.CommunityID, communityInfo, c.CommunityInfo)
header.CommunityData = &communityData
}
res = append(res, header)
@ -441,8 +441,8 @@ func (s *Service) fullCollectiblesDataToDetails(data []thirdparty.FullCollectibl
return nil, err
}
communityDetails := communityInfoToDetails(c.CollectibleData.CommunityID, communityInfo, c.CommunityInfo)
details.CommunityData = &communityDetails
communityData := communityInfoToData(c.CollectibleData.CommunityID, communityInfo, c.CommunityInfo)
details.CommunityData = &communityData
}
res = append(res, details)
@ -468,14 +468,14 @@ func (s *Service) fullCollectiblesDataToCommunityHeader(data []thirdparty.FullCo
continue
}
communityHeader := communityInfoToHeader(communityID, communityInfo, c.CommunityInfo)
communityData := communityInfoToData(communityID, communityInfo, c.CommunityInfo)
header := Collectible{
ID: collectibleID,
CollectibleData: &CollectibleData{
Name: c.CollectibleData.Name,
},
CommunityData: &communityHeader,
CommunityData: &communityData,
}
res = append(res, header)

View File

@ -93,24 +93,7 @@ func fullCollectibleDataToDetails(c thirdparty.FullCollectibleData) Collectible
return ret
}
func communityInfoToHeader(communityID string, community *thirdparty.CommunityInfo, communityCollectible *thirdparty.CollectibleCommunityInfo) CommunityData {
ret := CommunityData{
ID: communityID,
}
if community != nil {
ret.Name = community.CommunityName
ret.Color = community.CommunityColor
}
if communityCollectible != nil {
ret.PrivilegesLevel = communityCollectible.PrivilegesLevel
}
return ret
}
func communityInfoToDetails(communityID string, community *thirdparty.CommunityInfo, communityCollectible *thirdparty.CollectibleCommunityInfo) CommunityData {
func communityInfoToData(communityID string, community *thirdparty.CommunityInfo, communityCollectible *thirdparty.CollectibleCommunityInfo) CommunityData {
ret := CommunityData{
ID: communityID,
}