Fixed megacheck warnings
This commit is contained in:
parent
4e2da206ca
commit
6ee4b0248d
@ -27,6 +27,7 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if objectType == "all" || objectType == "anime" {
|
||||||
filepath.Walk(path.Join(arn.Root, "jobs/mal-download/anime"), func(name string, info os.FileInfo, err error) error {
|
filepath.Walk(path.Join(arn.Root, "jobs/mal-download/anime"), func(name string, info os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
@ -43,6 +44,7 @@ func main() {
|
|||||||
|
|
||||||
return readAnimeFile(name)
|
return readAnimeFile(name)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func readAnimeFile(name string) error {
|
func readAnimeFile(name string) error {
|
||||||
|
@ -8,28 +8,41 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Shell parameters
|
// Shell parameters
|
||||||
var animeID string
|
var objectType string
|
||||||
|
var objectID string
|
||||||
|
|
||||||
// Shell flags
|
// Shell flags
|
||||||
func init() {
|
func init() {
|
||||||
flag.StringVar(&animeID, "id", "", "ID of the notify.moe anime you want to refresh")
|
flag.StringVar(&objectType, "type", "all", "all | anime | character")
|
||||||
|
flag.StringVar(&objectID, "id", "", "ID of the notify.moe anime/character you want to refresh")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
}
|
}
|
||||||
|
|
||||||
// InvokeShellArgs ...
|
// InvokeShellArgs ...
|
||||||
func InvokeShellArgs() bool {
|
func InvokeShellArgs() bool {
|
||||||
if animeID != "" {
|
if objectID != "" {
|
||||||
anime, err := arn.GetAnime(animeID)
|
switch objectType {
|
||||||
|
case "anime":
|
||||||
if err != nil {
|
anime, err := arn.GetAnime(objectID)
|
||||||
panic(err)
|
arn.PanicOnError(err)
|
||||||
}
|
|
||||||
|
|
||||||
if anime.GetMapping("myanimelist/anime") == "" {
|
if anime.GetMapping("myanimelist/anime") == "" {
|
||||||
panic("No MAL ID")
|
panic("No MAL ID")
|
||||||
}
|
}
|
||||||
|
|
||||||
readAnimeFile(path.Join(arn.Root, "jobs/mal-download/anime", "anime-"+anime.GetMapping("myanimelist/anime")+".html"))
|
readAnimeFile(path.Join(arn.Root, "jobs", "mal-download", "anime", anime.GetMapping("myanimelist/anime")+".html.gz"))
|
||||||
|
|
||||||
|
case "character":
|
||||||
|
character, err := arn.GetCharacter(objectID)
|
||||||
|
arn.PanicOnError(err)
|
||||||
|
|
||||||
|
if character.GetMapping("myanimelist/character") == "" {
|
||||||
|
panic("No MAL ID")
|
||||||
|
}
|
||||||
|
|
||||||
|
readCharacterFile(path.Join(arn.Root, "jobs", "mal-download", "character", character.GetMapping("myanimelist/character")+".html.gz"))
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user