Skip to content

Commit

Permalink
Ln/native video (#120)
Browse files Browse the repository at this point in the history
* add VideoURLs to BitCloutBodySchema

* fix balances in tests

* fix balances in more tests
  • Loading branch information
lazynina authored Sep 28, 2021
1 parent 0e5e3e0 commit 82e7e98
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 52 deletions.
4 changes: 2 additions & 2 deletions lib/block_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,8 @@ func IsQuotedRepost(postEntry *PostEntry) bool {
func (pe *PostEntry) HasMedia() bool {
bodyJSONObj := DeSoBodySchema{}
err := json.Unmarshal(pe.Body, &bodyJSONObj)
//Return true if body json can be parsed and ImageUrls is not nil/non-empty or EmbedVideoUrl is not nil/non-empty
if (err == nil && len(bodyJSONObj.ImageURLs) > 0) || len(pe.PostExtraData["EmbedVideoURL"]) > 0 {
//Return true if body json can be parsed and ImageURLs or VideoURLs is not nil/non-empty or EmbedVideoUrl is not nil/non-empty
if (err == nil && len(bodyJSONObj.ImageURLs) > 0 || len(bodyJSONObj.VideoURLs) > 0) || len(pe.PostExtraData["EmbedVideoURL"]) > 0 {
return true
}
return false
Expand Down
Loading

0 comments on commit 82e7e98

Please sign in to comment.