fix:批量导入图文增加图片
This commit is contained in:
parent
68ef35a746
commit
4c1eb8f3db
@ -1347,28 +1347,32 @@ func ImportWorkBatch(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
// YouTube账号(第F列,row[5])
|
// YouTube账号(第F列,row[5])
|
||||||
if len(row) > 5 && utils.CleanString(row[5]) != "" {
|
if len(row) > 5 && utils.CleanString(row[5]) != "" {
|
||||||
mediaInfoResp, err = service.CastProvider.MediaInfo(context.Background(), &cast.MediaInfoReq{
|
temp.Remark = fmt.Sprintf("Youtube不能发图文")
|
||||||
ArtistUuid: temp.ArtistUuid,
|
|
||||||
PlatformID: cast.PlatformIDENUM_YOUTUBE,
|
|
||||||
PlatformUserName: utils.CleanString(row[5]),
|
|
||||||
})
|
|
||||||
if err != nil || mediaInfoResp.Info.MediaAccountUuid == "" {
|
|
||||||
temp.Remark = fmt.Sprintf("YouTube账号名不存在")
|
|
||||||
zap.L().Error("CastProvider.MediaInfo", zap.Error(err))
|
zap.L().Error("CastProvider.MediaInfo", zap.Error(err))
|
||||||
req.ImageWorks = append(req.ImageWorks, temp)
|
req.ImageWorks = append(req.ImageWorks, temp)
|
||||||
continue
|
continue
|
||||||
}
|
// mediaInfoResp, err = service.CastProvider.MediaInfo(context.Background(), &cast.MediaInfoReq{
|
||||||
temp.PublishConfig1 = &cast.PublishConfig{
|
// ArtistUuid: temp.ArtistUuid,
|
||||||
ForbidComment: 1,
|
// PlatformID: cast.PlatformIDENUM_YOUTUBE,
|
||||||
PublicType: 1,
|
// PlatformUserName: utils.CleanString(row[5]),
|
||||||
CanJoin: 1,
|
// })
|
||||||
CanQuote: 1,
|
// if err != nil || mediaInfoResp.Info.MediaAccountUuid == "" {
|
||||||
CanComment: 1,
|
// temp.Remark = fmt.Sprintf("YouTube账号名不存在")
|
||||||
IsAI: 1,
|
// zap.L().Error("CastProvider.MediaInfo", zap.Error(err))
|
||||||
}
|
// req.ImageWorks = append(req.ImageWorks, temp)
|
||||||
temp.PlatformIDs = append(temp.PlatformIDs, cast.PlatformIDENUM_YOUTUBE)
|
// continue
|
||||||
temp.MediaAccountNames = append(temp.MediaAccountNames, utils.CleanString(row[5]))
|
// }
|
||||||
temp.MediaAccountUuids = append(temp.MediaAccountUuids, mediaInfoResp.Info.MediaAccountUuid)
|
// temp.PublishConfig1 = &cast.PublishConfig{
|
||||||
|
// ForbidComment: 1,
|
||||||
|
// PublicType: 1,
|
||||||
|
// CanJoin: 1,
|
||||||
|
// CanQuote: 1,
|
||||||
|
// CanComment: 1,
|
||||||
|
// IsAI: 1,
|
||||||
|
// }
|
||||||
|
// temp.PlatformIDs = append(temp.PlatformIDs, cast.PlatformIDENUM_YOUTUBE)
|
||||||
|
// temp.MediaAccountNames = append(temp.MediaAccountNames, utils.CleanString(row[5]))
|
||||||
|
// temp.MediaAccountUuids = append(temp.MediaAccountUuids, mediaInfoResp.Info.MediaAccountUuid)
|
||||||
}
|
}
|
||||||
// Bluesky账号(第G列,row[6])
|
// Bluesky账号(第G列,row[6])
|
||||||
if len(row) > 6 && utils.CleanString(row[6]) != "" {
|
if len(row) > 6 && utils.CleanString(row[6]) != "" {
|
||||||
@ -1425,6 +1429,12 @@ func ImportWorkBatch(ctx *gin.Context) {
|
|||||||
req.ImageWorks = append(req.ImageWorks, temp)
|
req.ImageWorks = append(req.ImageWorks, temp)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// 判断图片数量是否超过4
|
||||||
|
if len(temp.Images) > 4 {
|
||||||
|
temp.Remark = "Bluesky 图片数量不能超过4"
|
||||||
|
req.ImageWorks = append(req.ImageWorks, temp)
|
||||||
|
continue
|
||||||
|
}
|
||||||
req.ImageWorks = append(req.ImageWorks, temp)
|
req.ImageWorks = append(req.ImageWorks, temp)
|
||||||
}
|
}
|
||||||
if len(req.ImageWorks) == 0 {
|
if len(req.ImageWorks) == 0 {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user