mirror of
https://github.com/ProudMuBai/GoFilm.git
synced 2026-05-17 10:47:30 +08:00
collect optimization
This commit is contained in:
@@ -199,7 +199,7 @@ func multipleSource(detail *system.MovieDetail) []system.PlayLinkVo {
|
||||
// 通过 name 以及 subTitle 生成 hash id 和 dbID 匹配次级站点播放信息
|
||||
// 使用map 防止清洗后的id重复
|
||||
idMap := make(map[string]int)
|
||||
idMap[system.GenerateHashKey(detail.Mid)] = 0
|
||||
idMap[system.GenerateHashKey(detail.Name)] = 0
|
||||
// 将subTitle进行切割
|
||||
if len(detail.SubTitle) > 0 {
|
||||
for _, s := range strings.Split(util.FormatSpecialChar(detail.SubTitle), ",") {
|
||||
@@ -218,7 +218,7 @@ func multipleSource(detail *system.MovieDetail) []system.PlayLinkVo {
|
||||
}
|
||||
// 获取满足条件的次级站点播放数据
|
||||
for _, s := range system.GetMultiplePlay(ids, detail.DbId) {
|
||||
l = append(l, system.PlayLinkVo{Id: s.Mid, Name: sMap[s.Mid].Name, LinkList: s.PlayList[0]})
|
||||
l = append(l, system.PlayLinkVo{Id: s.Sid, Name: sMap[s.Sid].Name, LinkList: s.PlayList[0]})
|
||||
}
|
||||
return l
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ func (sl *SpiderLogic) StartCollect(id string, h int) error {
|
||||
}
|
||||
// 存在则开启协程执行采集方法
|
||||
go func() {
|
||||
err := spider.HandleCollect(id, h)
|
||||
err := spider.HandleCollectRefine(id, h)
|
||||
if err != nil {
|
||||
log.Printf("资源站[%s]采集任务执行失败: %s", id, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user