From 4c1eb8f3db35d48f248d3762d4ef035eb55b3455 Mon Sep 17 00:00:00 2001 From: cjy Date: Tue, 6 Jan 2026 10:10:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=89=B9=E9=87=8F=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=9B=BE=E6=96=87=E5=A2=9E=E5=8A=A0=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/cast/work.go | 54 ++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/pkg/service/cast/work.go b/pkg/service/cast/work.go index 19a7da1..b8f1e57 100644 --- a/pkg/service/cast/work.go +++ b/pkg/service/cast/work.go @@ -1347,28 +1347,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]) != "" { @@ -1425,6 +1429,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 {