Skip to content

Commit 07a54be

Browse files
Lei DaRader
authored andcommitted
remove unused code
1 parent 3b11470 commit 07a54be

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

component/repo.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"fmt"
1212
"io"
1313
"log/slog"
14-
"net/http"
1514
"net/url"
1615
"path"
1716
"path/filepath"
@@ -1558,26 +1557,6 @@ func (c *repoComponentImpl) FileInfo(ctx context.Context, req *types.GetFileReq)
15581557
return file, nil
15591558
}
15601559

1561-
func (c *repoComponentImpl) getFilePreviewCode(fileContent []byte) types.FilePreviewCode {
1562-
// detect the file content type like text/plain, image/jpeg, etc
1563-
detectedType := http.DetectContentType(fileContent)
1564-
switch {
1565-
case strings.HasPrefix(detectedType, "text"):
1566-
return types.FilePreviewCodeNormal
1567-
default:
1568-
return types.FilePreviewCodeNotText
1569-
}
1570-
}
1571-
1572-
func (c *repoComponentImpl) adjustMaxFileSize(maxFileSize int64) int64 {
1573-
// same with aliyun green check large content size
1574-
const maxModerationContentSize = 100 * 9000
1575-
if maxFileSize == 0 || maxFileSize > maxModerationContentSize {
1576-
maxFileSize = maxModerationContentSize
1577-
}
1578-
return maxFileSize
1579-
}
1580-
15811560
func getTagScopeByRepoType(repoType types.RepositoryType) types.TagScope {
15821561
switch repoType {
15831562
case types.ModelRepo:

0 commit comments

Comments
 (0)