Skip to content

Commit

Permalink
Merge pull request #303 from gen-mind/main
Browse files Browse the repository at this point in the history
Main to develop
  • Loading branch information
apaladiychuk authored Jun 27, 2024
2 parents be32691 + 17c8ab4 commit ec4542f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/backend/connector/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ func (e *Executor) saveContent(ctx context.Context, response *connector.Response
if err != nil {
return err
}
zap.S().Debugf("save fileName %s response name %s ", fileName, response.Name)
response.URL = fmt.Sprintf("minio:%s:%s", response.Content.Bucket, fileName)
return nil
}
Expand Down
10 changes: 5 additions & 5 deletions src/backend/core/connector/microsoft-core/drive.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ func (c *MSDrive) getFile(item *DriveChildBody) error {
// try to recognize type of file by content

if payload.FileType == proto.FileType_UNKNOWN {
zap.S().Infof("unsupported file %s type %s -- %s", item.Name, item.File.MimeType, payload.MimeType)
return nil
}

Expand All @@ -139,11 +138,11 @@ func (c *MSDrive) getFile(item *DriveChildBody) error {

func (c *MSDrive) recognizeFiletype(item *DriveChildBody) (string, proto.FileType) {

mimeTypeParts := strings.Split(item.File.MimeType, ";")
//mimeTypeParts := strings.Split(item.File.MimeType, ";")

if fileType, ok := model.SupportedMimeTypes[mimeTypeParts[0]]; ok {
return mimeTypeParts[0], fileType
}
//if fileType, ok := model.SupportedMimeTypes[mimeTypeParts[0]]; ok {
// return mimeTypeParts[0], fileType
//}
// recognize fileType by filename extension
fileNameParts := strings.Split(item.Name, ".")
if len(fileNameParts) > 1 {
Expand All @@ -154,6 +153,7 @@ func (c *MSDrive) recognizeFiletype(item *DriveChildBody) (string, proto.FileTyp
return mimeType, model.SupportedMimeTypes[mimeType]
}
c.unsupportedType[fileNameParts[len(fileNameParts)-1]] = true
zap.S().Infof("unsupported file %s type %s -- %s", item.Name, fileNameParts[len(fileNameParts)-1], item.File.MimeType)
}
// recognize filetype by content
//response, err := c.client.R().
Expand Down

0 comments on commit ec4542f

Please sign in to comment.