Skip to content

Commit

Permalink
feat: pixiv better log
Browse files Browse the repository at this point in the history
  • Loading branch information
RicheyJang committed Feb 25, 2022
1 parent 52e3539 commit 15e342b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions plugins/pixiv/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
// 从Lolicon API随机获取图片,返回图片URL切片
func getPicturesFromLolicon(tags []string, num int, isR18 bool) []PictureInfo {
if num <= 0 {
log.Warnf("num <= 0, num: %d", num)
return []PictureInfo{}
}
// 请求
Expand Down
1 change: 1 addition & 0 deletions plugins/pixiv/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (d *downloader) get() {
}
single := float64(scale) / float64(sum)
pics := getter(d.tags, int(float64(d.cap)*single)+1, d.isR18)
log.Infof("From %v get %d pics", k, len(pics))
for i := range pics { // 标注来源图库
pics[i].Src = k
}
Expand Down
4 changes: 3 additions & 1 deletion plugins/pixiv/omega.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ func getPicturesFromOmega(tags []string, num int, isR18 bool) (pics []PictureInf
})
}
// 刷新图片URL
go flushOmegaURL(models)
if len(models) > 0 {
go flushOmegaURL(models)
}
return
}

Expand Down

0 comments on commit 15e342b

Please sign in to comment.