diff --git a/pkg/service/cast/work.go b/pkg/service/cast/work.go index 6470e54..75cd9f3 100644 --- a/pkg/service/cast/work.go +++ b/pkg/service/cast/work.go @@ -1447,28 +1447,32 @@ func ImportWorkBatch(ctx *gin.Context) { } // YouTube账号(第F列,row[5]) if len(row) > 5 && utils.CleanString(row[5]) != "" { - mediaInfoResp, err = service.CastProvider.MediaInfo(context.Background(), &cast.MediaInfoReq{ - 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)) - req.ImageWorks = append(req.ImageWorks, temp) - continue - } - 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) + temp.Remark = fmt.Sprintf("Youtube不能发图文") + zap.L().Error("CastProvider.MediaInfo", zap.Error(err)) + req.ImageWorks = append(req.ImageWorks, temp) + continue + // mediaInfoResp, err = service.CastProvider.MediaInfo(context.Background(), &cast.MediaInfoReq{ + // 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)) + // req.ImageWorks = append(req.ImageWorks, temp) + // continue + // } + // 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]) if len(row) > 6 && utils.CleanString(row[6]) != "" { @@ -1525,6 +1529,12 @@ func ImportWorkBatch(ctx *gin.Context) { req.ImageWorks = append(req.ImageWorks, temp) continue } + // 判断图片数量是否超过4 + if len(temp.Images) > 4 { + temp.Remark = "Bluesky 图片数量不能超过4" + req.ImageWorks = append(req.ImageWorks, temp) + continue + } req.ImageWorks = append(req.ImageWorks, temp) } if len(req.ImageWorks) == 0 {