GetFrontNameAndOrgName 返回的名称包含,那个网站下载的,这个网站中排名第几,文件名
(log *logrus.Logger, info *supplier.SubInfo)
| 209 | |
| 210 | // GetFrontNameAndOrgName 返回的名称包含,那个网站下载的,这个网站中排名第几,文件名 |
| 211 | func GetFrontNameAndOrgName(log *logrus.Logger, info *supplier.SubInfo) string { |
| 212 | |
| 213 | infoName := "" |
| 214 | fileName, err := decode.GetVideoInfoFromFileName(info.Name) |
| 215 | if err != nil { |
| 216 | log.Warnln("", err) |
| 217 | // 替换特殊字符 |
| 218 | infoName = pkg.ReplaceSpecString(info.Name, "x") |
| 219 | } else { |
| 220 | infoName = fileName.Title + "_S" + strconv.Itoa(fileName.Season) + "E" + strconv.Itoa(fileName.Episode) + filepath.Ext(info.Name) |
| 221 | } |
| 222 | if len(infoName) < 1 { |
| 223 | infoName = pkg.RandStringBytesMaskImprSrcSB(10) + filepath.Ext(info.Name) |
| 224 | } |
| 225 | info.Name = infoName |
| 226 | |
| 227 | return "[" + info.FromWhere + "]_" + strconv.FormatInt(info.TopN, 10) + "_" + infoName |
| 228 | } |
| 229 | |
| 230 | // AddFrontName 添加文件的前缀 |
| 231 | func AddFrontName(info supplier.SubInfo, orgName string) string { |
no test coverage detected