2018-04-12 17:05:05 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"path"
|
|
|
|
|
|
|
|
"github.com/animenotifier/arn"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Shell parameters
|
|
|
|
var animeID string
|
|
|
|
|
|
|
|
// Shell flags
|
|
|
|
func init() {
|
|
|
|
flag.StringVar(&animeID, "id", "", "ID of the notify.moe anime you want to refresh")
|
|
|
|
flag.Parse()
|
|
|
|
}
|
|
|
|
|
|
|
|
// InvokeShellArgs ...
|
|
|
|
func InvokeShellArgs() bool {
|
|
|
|
if animeID != "" {
|
|
|
|
anime, err := arn.GetAnime(animeID)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if anime.GetMapping("myanimelist/anime") == "" {
|
|
|
|
panic("No MAL ID")
|
|
|
|
}
|
|
|
|
|
2018-10-30 03:01:42 +00:00
|
|
|
readAnimeFile(path.Join(arn.Root, "jobs/mal-download/anime", "anime-"+anime.GetMapping("myanimelist/anime")+".html"))
|
2018-04-12 17:05:05 +00:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
return false
|
|
|
|
}
|