Added episodes and airing dates
This commit is contained in:
parent
9bae97f9db
commit
f4e9b31fb8
@ -61,6 +61,10 @@ func sync(data *kitsu.Anime) {
|
||||
anime.Mappings = []*arn.Mapping{}
|
||||
}
|
||||
|
||||
if anime.Episodes == nil {
|
||||
anime.Episodes = []*arn.AnimeEpisode{}
|
||||
}
|
||||
|
||||
// NSFW
|
||||
if attr.Nsfw {
|
||||
anime.NSFW = 1
|
||||
|
@ -143,6 +143,19 @@ component Anime(anime *arn.Anime, tracks []*arn.SoundTrack, user *arn.User)
|
||||
.sound-tracks
|
||||
each track in tracks
|
||||
SoundTrack(track)
|
||||
|
||||
if len(anime.Episodes) > 0
|
||||
h3.anime-section-name Episodes
|
||||
table
|
||||
tbody
|
||||
each episode in anime.Episodes
|
||||
tr.episode
|
||||
td.episode-number= episode.Number
|
||||
td.episode-title= episode.Title.Japanese
|
||||
td.episode-actions
|
||||
a(href="https://translate.google.com/#ja/en/" + episode.Title.Japanese, target="_blank", rel="noopener")
|
||||
RawIcon("google")
|
||||
td.episode-airing-date-start= episode.AiringDate.StartDateHuman()
|
||||
|
||||
//- h3.anime-section-name Reviews
|
||||
//- p Coming soon.
|
||||
|
21
pages/anime/episode.scarlet
Normal file
21
pages/anime/episode.scarlet
Normal file
@ -0,0 +1,21 @@
|
||||
.episode
|
||||
horizontal
|
||||
|
||||
.episode-number
|
||||
flex-basis 3.2rem
|
||||
// text-align right
|
||||
|
||||
.episode-title
|
||||
flex 1
|
||||
|
||||
.episode-airing-date-start
|
||||
flex-basis 270px
|
||||
text-align right
|
||||
|
||||
< 800px
|
||||
.episode-airing-date-start
|
||||
display none
|
||||
|
||||
< 500px
|
||||
.episode-actions
|
||||
display none
|
32
patches/add-empty-episodes/main.go
Normal file
32
patches/add-empty-episodes/main.go
Normal file
@ -0,0 +1,32 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Get a stream of all anime
|
||||
allAnime, err := arn.AllAnime()
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Iterate over the stream
|
||||
for _, anime := range allAnime {
|
||||
if anime.Mappings == nil {
|
||||
anime.Mappings = []*arn.Mapping{}
|
||||
}
|
||||
|
||||
if anime.Episodes == nil {
|
||||
anime.Episodes = []*arn.AnimeEpisode{}
|
||||
}
|
||||
|
||||
err := anime.Save()
|
||||
|
||||
if err != nil {
|
||||
color.Red("Error saving anime: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
@ -36,6 +36,11 @@ mixin clip-long-text
|
||||
white-space nowrap
|
||||
text-overflow ellipsis
|
||||
|
||||
mixin bg-dark-up
|
||||
background-color transparent
|
||||
:hover
|
||||
background-color rgba(0, 0, 0, 0.015)
|
||||
|
||||
mixin light-up
|
||||
filter brightness(0.4) saturate(1)
|
||||
:hover
|
||||
|
@ -19,5 +19,4 @@ th
|
||||
|
||||
tbody
|
||||
tr
|
||||
:hover
|
||||
background-color rgba(0, 0, 0, 0.015)
|
||||
bg-dark-up
|
Loading…
Reference in New Issue
Block a user