some fixups to grab "image" property as seen on lemmy
This commit is contained in:
parent
314e0bb805
commit
3b036f4975
|
@ -689,7 +689,9 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
|||
case "Audio":
|
||||
fallthrough
|
||||
case "Image":
|
||||
if what == "Image" {
|
||||
preferorig = true
|
||||
}
|
||||
fallthrough
|
||||
case "Video":
|
||||
fallthrough
|
||||
|
@ -837,6 +839,9 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
|||
procatt := func(att junk.Junk) {
|
||||
at, _ := att.GetString("type")
|
||||
mt, _ := att.GetString("mediaType")
|
||||
if mt == "" {
|
||||
mt = "image"
|
||||
}
|
||||
u, ok := att.GetString("url")
|
||||
if !ok {
|
||||
u, ok = att.GetString("href")
|
||||
|
@ -890,6 +895,9 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
|||
}
|
||||
numatts++
|
||||
}
|
||||
if img, ok := obj.GetMap("image"); ok {
|
||||
procatt(img)
|
||||
}
|
||||
if preferorig {
|
||||
atts, _ := obj.GetArray("url")
|
||||
for _, atti := range atts {
|
||||
|
|
Loading…
Reference in New Issue