Fixed edge case
This commit is contained in:
@@ -24,6 +24,7 @@ type InstaPost struct {
|
||||
Likes int `json:"likes"`
|
||||
Views int `json:"views"`
|
||||
URL string `json:"url"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
//go:embed js/instagram_followers_urls.js
|
||||
@@ -139,8 +140,10 @@ func (r *Runner) GetIntsaEgagement(urls []string) []InstaPost {
|
||||
}
|
||||
|
||||
if res.Views != 0 {
|
||||
res.Type = "Video"
|
||||
res.Engagement = res.Views + res.Comments
|
||||
} else {
|
||||
res.Type = "Image"
|
||||
res.Engagement = res.Likes + res.Comments
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user