Cleanup
This commit is contained in:
31
pages/soundtrack/soundtrack.go
Normal file
31
pages/soundtrack/soundtrack.go
Normal file
@ -0,0 +1,31 @@
|
||||
package soundtrack
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
)
|
||||
|
||||
// Get track.
|
||||
func Get(ctx *aero.Context) string {
|
||||
id := ctx.Get("id")
|
||||
track, err := arn.GetSoundTrack(id)
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusNotFound, "Track not found", err)
|
||||
}
|
||||
|
||||
ctx.Data = &arn.OpenGraph{
|
||||
Tags: map[string]string{
|
||||
"og:title": track.Media[0].Title,
|
||||
"og:image": track.Anime()[0].Image.Large,
|
||||
"og:url": "https://" + ctx.App.Config.Domain + track.Link(),
|
||||
"og:site_name": "notify.moe",
|
||||
"og:type": "music.song",
|
||||
},
|
||||
}
|
||||
|
||||
return ctx.HTML(components.Track(track))
|
||||
}
|
5
pages/soundtrack/soundtrack.pixy
Normal file
5
pages/soundtrack/soundtrack.pixy
Normal file
@ -0,0 +1,5 @@
|
||||
component Track(track *arn.SoundTrack)
|
||||
h1= track.Media[0].Title
|
||||
|
||||
.sound-tracks
|
||||
SoundTrackAllMedia(track)
|
Reference in New Issue
Block a user