Tracks have permalinks now

This commit is contained in:
2017-06-28 00:16:45 +02:00
parent 5099c0b0e7
commit d5dcd9c909
9 changed files with 89 additions and 12 deletions

View File

@ -23,12 +23,13 @@ var colorPool = []*color.Color{
}
var jobs = map[string]time.Duration{
"active-users": 1 * time.Minute,
"avatars": 1 * time.Hour,
"sync-anime": 10 * time.Hour,
"popular-anime": 11 * time.Hour,
"airing-anime": 12 * time.Hour,
"search-index": 13 * time.Hour,
"active-users": 1 * time.Minute,
"avatars": 1 * time.Hour,
"refresh-track-titles": 10 * time.Hour,
"sync-anime": 12 * time.Hour,
"popular-anime": 12 * time.Hour,
"airing-anime": 12 * time.Hour,
"search-index": 12 * time.Hour,
}
func main() {

View File

@ -0,0 +1,37 @@
package main
import (
"github.com/animenotifier/arn"
"github.com/fatih/color"
)
func main() {
color.Yellow("Refreshing track titles")
// Get a stream of all soundtracks
soundtracks, err := arn.StreamSoundTracks()
if err != nil {
panic(err)
}
// Iterate over the stream
for track := range soundtracks {
sync(track)
}
color.Green("Finished.")
}
func sync(track *arn.SoundTrack) {
for _, media := range track.Media {
media.RefreshMetaData()
println(media.Service, media.Title)
}
err := track.Save()
if err != nil {
panic(err)
}
}

View File

@ -22,7 +22,7 @@ func main() {
sync(anime)
}
println("Finished.")
color.Green("Finished.")
}
func sync(data *kitsu.Anime) {