2017-06-27 22:16:45 +00:00
|
|
|
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) {
|
2017-10-11 08:37:33 +00:00
|
|
|
// for _, media := range track.Media {
|
|
|
|
// media.RefreshMetaData()
|
|
|
|
// println(media.Service, media.Title)
|
|
|
|
// }
|
2017-06-27 22:16:45 +00:00
|
|
|
|
2017-10-11 08:37:33 +00:00
|
|
|
// err := track.Save()
|
2017-06-27 22:16:45 +00:00
|
|
|
|
2017-10-11 08:37:33 +00:00
|
|
|
// if err != nil {
|
|
|
|
// panic(err)
|
|
|
|
// }
|
2017-06-27 22:16:45 +00:00
|
|
|
}
|