Improved shoboi sync
This commit is contained in:
parent
2b8503f255
commit
524cc4311d
@ -64,17 +64,30 @@ func sync(anime *arn.Anime) bool {
|
|||||||
|
|
||||||
// Search for a specific title
|
// Search for a specific title
|
||||||
func search(anime *arn.Anime, title string) {
|
func search(anime *arn.Anime, title string) {
|
||||||
tid, err := shoboi.SearchAnime(title)
|
shoboi, err := shoboi.SearchAnime(title)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
color.Red(err.Error())
|
color.Red(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if tid == "" {
|
if shoboi == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// This will start a goroutine that saves the anime
|
// Copy titles
|
||||||
anime.AddMapping("shoboi/anime", tid, "")
|
if shoboi.TitleJapanese != "" {
|
||||||
|
anime.Title.Japanese = shoboi.TitleJapanese
|
||||||
|
}
|
||||||
|
|
||||||
|
if shoboi.TitleHiragana != "" {
|
||||||
|
anime.Title.Hiragana = shoboi.TitleHiragana
|
||||||
|
}
|
||||||
|
|
||||||
|
if shoboi.FirstChannel != "" {
|
||||||
|
anime.FirstChannel = shoboi.FirstChannel
|
||||||
|
}
|
||||||
|
|
||||||
|
// This will start a goroutine that saves the anime
|
||||||
|
anime.AddMapping("shoboi/anime", shoboi.TID, "")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user