Added video to soundtrack OpenGraph
This commit is contained in:
parent
3f27562581
commit
677dc45184
@ -8,13 +8,15 @@ component Group(group *arn.Group)
|
||||
|
||||
.group-view
|
||||
.group-sidebar.mountable
|
||||
.group-sidebar-section
|
||||
h3 Description
|
||||
.group-description!= markdown.Render(group.Description)
|
||||
if group.Description != ""
|
||||
.group-sidebar-section
|
||||
h3 Description
|
||||
.group-description!= markdown.Render(group.Description)
|
||||
|
||||
.group-sidebar-section
|
||||
h3 Rules
|
||||
.group-rules!= markdown.Render(group.Rules)
|
||||
if group.Rules != ""
|
||||
.group-sidebar-section
|
||||
h3 Rules
|
||||
.group-rules!= markdown.Render(group.Rules)
|
||||
|
||||
.group-sidebar-section
|
||||
h3 Members
|
||||
|
@ -17,7 +17,7 @@ func Get(ctx *aero.Context) string {
|
||||
return ctx.Error(http.StatusNotFound, "Track not found", err)
|
||||
}
|
||||
|
||||
ctx.Data = &arn.OpenGraph{
|
||||
openGraph := &arn.OpenGraph{
|
||||
Tags: map[string]string{
|
||||
"og:title": track.Title,
|
||||
"og:url": "https://" + ctx.App.Config.Domain + track.Link(),
|
||||
@ -27,8 +27,16 @@ func Get(ctx *aero.Context) string {
|
||||
}
|
||||
|
||||
if track.MainAnime() != nil {
|
||||
ctx.Data.(*arn.OpenGraph).Tags["og:image"] = track.MainAnime().Image.Large
|
||||
openGraph.Tags["og:image"] = track.MainAnime().Image.Large
|
||||
}
|
||||
|
||||
// Set video so that it can be played
|
||||
youtube := track.MediaByName("Youtube")
|
||||
if len(youtube) > 0 {
|
||||
openGraph.Tags["og:video"] = "https://www.youtube.com/v/" + youtube[0].ServiceID
|
||||
}
|
||||
|
||||
ctx.Data = openGraph
|
||||
|
||||
return ctx.HTML(components.Track(track))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user