Fix opengraph icons
This commit is contained in:
@@ -59,12 +59,14 @@ func (wc *WebController) metadataFromFile(f pixelapi.FileInfo) (og ogData) {
|
||||
og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
|
||||
} else if strings.HasPrefix(f.MimeType, "audio") {
|
||||
og.addProp("og:type", "music.song")
|
||||
og.addProp("og:image", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
|
||||
og.addProp("og:audio", wc.websiteAddress+"/api/file/"+f.ID)
|
||||
og.addProp("og:audio:secure_url", wc.websiteAddress+"/api/file/"+f.ID)
|
||||
og.addProp("og:audio:type", f.MimeType)
|
||||
og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
|
||||
} else {
|
||||
og.addProp("og:type", "website")
|
||||
og.addProp("og:image", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
|
||||
og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
|
||||
}
|
||||
return og
|
||||
|
@@ -114,15 +114,6 @@ type hsl struct {
|
||||
Lightness float64
|
||||
}
|
||||
|
||||
func (h hsl) cssString() string {
|
||||
return fmt.Sprintf(
|
||||
"hsl(%d, %.3f%%, %.3f%%)",
|
||||
h.Hue,
|
||||
h.Saturation*100,
|
||||
h.Lightness*100,
|
||||
)
|
||||
}
|
||||
|
||||
func (orig hsl) RGB() string {
|
||||
var r, g, b, q, p float64
|
||||
var h, s, l = float64(orig.Hue) / 360, orig.Saturation, orig.Lightness
|
||||
|
Reference in New Issue
Block a user