Fixed old stuff
This commit is contained in:
parent
1da3e3f2f8
commit
b6fb1c1f08
@ -68,10 +68,6 @@ func sync(data *kitsu.Anime) *arn.Anime {
|
||||
anime.Mappings = []*arn.Mapping{}
|
||||
}
|
||||
|
||||
if anime.Episodes == nil {
|
||||
anime.Episodes = []*arn.AnimeEpisode{}
|
||||
}
|
||||
|
||||
// Prefer Shoboi Japanese titles over Kitsu JP titles
|
||||
if anime.GetMapping("shoboi/anime") != "" {
|
||||
// Only take Kitsu title when our JP title is empty
|
||||
|
@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -48,10 +47,10 @@ func main() {
|
||||
|
||||
episodes := feed.Episodes
|
||||
|
||||
// Sort by episode number
|
||||
sort.Slice(episodes, func(a, b int) bool {
|
||||
return episodes[a].Number < episodes[b].Number
|
||||
})
|
||||
// // Sort by episode number
|
||||
// sort.Slice(episodes, func(a, b int) bool {
|
||||
// return episodes[a].Number < episodes[b].Number
|
||||
// })
|
||||
|
||||
for _, episode := range episodes {
|
||||
arnEpisode := anime.EpisodeByNumber(episode.Number)
|
||||
|
@ -156,8 +156,14 @@ component Anime(anime *arn.Anime, tracks []*arn.SoundTrack, user *arn.User, epis
|
||||
tbody
|
||||
each episode in anime.Episodes().Items
|
||||
tr.episode
|
||||
td.episode-number= episode.Number
|
||||
td.episode-title= episode.Title.Japanese
|
||||
td.episode-number
|
||||
if episode.Number != -1
|
||||
span= episode.Number
|
||||
td.episode-title
|
||||
if episode.Title.Japanese != ""
|
||||
span= episode.Title.Japanese
|
||||
else
|
||||
span -
|
||||
td.episode-actions
|
||||
for name, link := range episode.Links
|
||||
a(href=link, target="_blank", rel="noopener", title="Watch episode " + toString(episode.Number) + " on " + name)
|
||||
|
7
pages/animeepisode/animeepisode.go
Normal file
7
pages/animeepisode/animeepisode.go
Normal file
@ -0,0 +1,7 @@
|
||||
package animeepisode
|
||||
|
||||
import "github.com/aerogo/aero"
|
||||
|
||||
func Get(ctx *aero.Context) string {
|
||||
return ctx.HTML("")
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
component API(types []string)
|
||||
h3 API
|
||||
h1 API
|
||||
|
||||
table
|
||||
//- thead
|
||||
|
@ -1,4 +1,6 @@
|
||||
component NewThread(user *arn.User)
|
||||
h1 New thread
|
||||
|
||||
.widget-form
|
||||
.widget
|
||||
input#title.widget-element(type="text", placeholder="Title")
|
||||
|
@ -1,32 +0,0 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/animenotifier/arn"
|
||||
)
|
||||
|
||||
func main() {
|
||||
for anime := range arn.MustStreamAnime() {
|
||||
arn.PanicOnError(arn.DB.Set("AnimeEpisodes", anime.ID, &arn.AnimeEpisodes{
|
||||
AnimeID: anime.ID,
|
||||
Items: anime.Episodes,
|
||||
}))
|
||||
|
||||
anime.Episodes = anime.Episodes[:0]
|
||||
anime.MustSave()
|
||||
}
|
||||
}
|
@ -60,6 +60,11 @@ function getRemainingTime(remaining: number): string {
|
||||
}
|
||||
|
||||
export function displayAiringDate(element: HTMLElement, now: Date) {
|
||||
if(element.dataset.startDate === "") {
|
||||
element.innerText = ""
|
||||
return
|
||||
}
|
||||
|
||||
let startDate = new Date(element.dataset.startDate)
|
||||
let endDate = new Date(element.dataset.endDate)
|
||||
|
||||
@ -91,6 +96,11 @@ export function displayAiringDate(element: HTMLElement, now: Date) {
|
||||
}
|
||||
|
||||
export function displayDate(element: HTMLElement, now: Date) {
|
||||
if(element.dataset.date === "") {
|
||||
element.innerText = ""
|
||||
return
|
||||
}
|
||||
|
||||
let startDate = new Date(element.dataset.date)
|
||||
|
||||
let h = startDate.getHours()
|
||||
|
Loading…
Reference in New Issue
Block a user