Added tracks to anime pages

This commit is contained in:
Eduard Urbach 2017-06-28 01:05:39 +02:00
parent d5dcd9c909
commit bfbce4c9a2
2 changed files with 15 additions and 6 deletions

View File

@ -19,5 +19,11 @@ func Get(ctx *aero.Context) string {
return ctx.Error(http.StatusNotFound, "Anime not found", err)
}
return ctx.HTML(components.Anime(anime, user))
tracks, err := arn.GetSoundTracksByTag("anime:" + anime.ID)
if err != nil {
return ctx.Error(http.StatusNotFound, "Error fetching soundtracks", err)
}
return ctx.HTML(components.Anime(anime, tracks, user))
}

View File

@ -1,4 +1,4 @@
component Anime(anime *arn.Anime, user *arn.User)
component Anime(anime *arn.Anime, tracks []*arn.SoundTrack, user *arn.User)
.anime-header(data-id=anime.ID)
if anime.Image.Small != ""
.anime-image-container
@ -133,11 +133,14 @@ component Anime(anime *arn.Anime, user *arn.User)
//- if providers.Nyaa && providers.Nyaa.episodes !== undefined
//- span(class=providers.Nyaa.episodes === 0 ? "entry-error" : "entry-ok")= providers.Nyaa.episodes + " eps"
if len(tracks) > 0
h3.anime-section-name Tracks
p Coming soon.
.sound-tracks
each track in tracks
SoundTrack(track)
h3.anime-section-name Reviews
p Coming soon.
//- h3.anime-section-name Reviews
//- p Coming soon.
h3.anime-section-name Links
.light-button-group