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

@ -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)
}
}