Skip to content

Commit

Permalink
补充日志的细节
Browse files Browse the repository at this point in the history
Signed-off-by: allan716 <525223688@qq.com>
  • Loading branch information
allanpk716 committed Jun 28, 2021
1 parent cfe5181 commit dd64f80
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion movie_helper/movieHelper.go
Expand Up @@ -22,7 +22,7 @@ func OneMovieDlSubInAllSite(Suppliers []_interface.ISupplier, oneVideoFullPath s
go func() {
subInfos, err := OneMovieDlSubInOneSite(oneVideoFullPath, i, supplier)
if err != nil {
model.GetLogger().Errorln("oneMovieDlSubInOneSite", err)
model.GetLogger().Errorln(supplier.GetSupplierName(), "oneMovieDlSubInOneSite", err)
}
subInfosChannel <- subInfos
}()
Expand Down
2 changes: 1 addition & 1 deletion series_helper/seriesHelper.go
Expand Up @@ -192,7 +192,7 @@ func OneSeriesDlSubInAllSite(Suppliers []_interface.ISupplier, seriesInfo *commo
// 一次性把这一部连续剧的所有字幕下载完
subInfos, err := supplier.GetSubListFromFile4Series(seriesInfo)
if err != nil {
model.GetLogger().Errorln("GetSubListFromFile4Series", err)
model.GetLogger().Errorln(supplier.GetSupplierName(), "GetSubListFromFile4Series", err)
}
// 把后缀名给改好
model.ChangeVideoExt2SubExt(subInfos)
Expand Down
17 changes: 9 additions & 8 deletions sub_supplier/subSupplierHub.go
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/allanpk716/ChineseSubFinder/movie_helper"
"github.com/allanpk716/ChineseSubFinder/series_helper"
"github.com/sirupsen/logrus"
"gopkg.in/errgo.v2/fmt/errors"
"path/filepath"
)

Expand Down Expand Up @@ -34,15 +35,15 @@ func (d SubSupplierHub) DownloadSub4Movie(videoFullPath string, index int) ([]st
// 跳过中文的电影,不是一定要跳过的
skip, err := movie_helper.SkipChineseMovie(videoFullPath, d.Suppliers[0].GetReqParam())
if err != nil {
d.log.Error("SkipChineseMovie", err)
d.log.Warnln("SkipChineseMovie", videoFullPath, err)
}
if skip == true {
return nil, nil
}

needDlSub, err := movie_helper.MovieNeedDlSub(videoFullPath)
if err != nil {
return nil, err
return nil, errors.Newf("MovieNeedDlSub %v %v", videoFullPath , err)
}
if needDlSub == true {
// 需要下载字幕
Expand All @@ -51,7 +52,7 @@ func (d SubSupplierHub) DownloadSub4Movie(videoFullPath string, index int) ([]st
// 整理字幕,比如解压什么的
organizeSubFiles, err := model.OrganizeDlSubFiles(filepath.Base(videoFullPath), subInfos)
if err != nil {
return nil, err
return nil, errors.Newf("OrganizeDlSubFiles %v %v", videoFullPath , err)
}
// 因为是下载电影,需要合并返回
var outSubFileFullPathList = make([]string, 0)
Expand All @@ -69,23 +70,23 @@ func (d SubSupplierHub) DownloadSub4Movie(videoFullPath string, index int) ([]st
func (d SubSupplierHub) DownloadSub4Series(seriesDirPath string, index int) (*common.SeriesInfo, map[string][]string, error) {

// 跳过中文的连续剧,不是一定要跳过的
skip, idmbInfo, err := series_helper.SkipChineseSeries(seriesDirPath, d.Suppliers[0].GetReqParam())
skip, imdbInfo, err := series_helper.SkipChineseSeries(seriesDirPath, d.Suppliers[0].GetReqParam())
if err != nil {
d.log.Error("SkipChineseSeries", err)
d.log.Warnln("SkipChineseSeries", seriesDirPath, err)
}
if skip == true {
return nil, nil, nil
}
// 读取本地的视频和字幕信息
seriesInfo, err := series_helper.ReadSeriesInfoFromDir(seriesDirPath, idmbInfo)
seriesInfo, err := series_helper.ReadSeriesInfoFromDir(seriesDirPath, imdbInfo)
if err != nil {
return nil, nil, err
return nil, nil, errors.Newf("ReadSeriesInfoFromDir %v %v", seriesDirPath , err)
}
// 下载好的字幕
subInfos := series_helper.OneSeriesDlSubInAllSite(d.Suppliers, seriesInfo, index)
// 整理字幕,比如解压什么的
// 每一集 SxEx - 对应解压整理后的字幕列表
organizeSubFiles, err := model.OrganizeDlSubFiles(filepath.Base(seriesDirPath), subInfos)

return seriesInfo, organizeSubFiles, err
return seriesInfo, organizeSubFiles, errors.Newf("OrganizeDlSubFiles %v %v", seriesDirPath , err)
}
2 changes: 1 addition & 1 deletion sub_supplier/subhd/subhd.go
Expand Up @@ -242,7 +242,7 @@ func (s Supplier) whichEpisodeNeedDownloadSub(seriesInfo *common.SeriesInfo, all
value[0].Episode = epsInfo.Episode
subInfoNeedDownload = append(subInfoNeedDownload, value[0])
} else {
s.log.Infoln("Not Find Sub can be download", epsInfo.Title, epsInfo.Season, epsInfo.Episode)
s.log.Infoln("SubHD Not Find Sub can be download", epsInfo.Title, epsInfo.Season, epsInfo.Episode)
}
}
// 全季的字幕列表,也拼进去,后面进行下载
Expand Down
2 changes: 1 addition & 1 deletion sub_supplier/zimuku/zimuku.go
Expand Up @@ -214,7 +214,7 @@ func (s Supplier) whichEpisodeNeedDownloadSub(seriesInfo *common.SeriesInfo, All
value[0].Episode = epsInfo.Episode
subInfoNeedDownload = append(subInfoNeedDownload, value[0])
} else {
s.log.Infoln("Not Find Sub can be download", epsInfo.Title, epsInfo.Season, epsInfo.Episode)
s.log.Infoln("ZiMuKu Not Find Sub can be download", epsInfo.Title, epsInfo.Season, epsInfo.Episode)
}
}
// 全季的字幕列表,也拼进去,后面进行下载
Expand Down

0 comments on commit dd64f80

Please sign in to comment.