Simplified video info refresh

This commit is contained in:
Eduard Urbach 2018-10-28 10:20:59 +09:00
parent 3bd192cbd3
commit ae7ec62125

View File

@ -1,11 +1,8 @@
package main package main
import ( import (
"path"
"github.com/animenotifier/arn" "github.com/animenotifier/arn"
"github.com/animenotifier/arn/stringutils" "github.com/animenotifier/arn/stringutils"
"github.com/animenotifier/arn/video"
"github.com/fatih/color" "github.com/fatih/color"
) )
@ -16,11 +13,7 @@ func main() {
defer arn.Node.Close() defer arn.Node.Close()
for amv := range arn.StreamAMVs() { for amv := range arn.StreamAMVs() {
if amv.File == "" { err := amv.RefreshInfo()
continue
}
info, err := video.GetInfo(path.Join(arn.Root, "videos", "amvs", amv.File))
if err != nil { if err != nil {
color.Red(err.Error()) color.Red(err.Error())
@ -28,9 +21,7 @@ func main() {
} }
color.Green(amv.Title.Canonical) color.Green(amv.Title.Canonical)
stringutils.PrettyPrint(info) stringutils.PrettyPrint(amv.Info)
amv.Info = *info
amv.Save() amv.Save()
} }
} }