|
|
|
@@ -3,6 +3,7 @@ package routers |
|
|
|
import ( |
|
|
|
"encoding/json" |
|
|
|
"fmt" |
|
|
|
"path/filepath" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
|
|
|
|
@@ -212,9 +213,9 @@ func makeRepoResult(sRes *elastic.SearchResult, Key string, OnlyReturnNum bool) |
|
|
|
} |
|
|
|
if recordSource["avatar"] != nil { |
|
|
|
avatarstr := recordSource["avatar"].(string) |
|
|
|
if len(avatarstr) == 0{ |
|
|
|
if len(avatarstr) == 0 { |
|
|
|
record["avatar"] = setting.RepositoryAvatarFallbackImage |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
record["avatar"] = filepath.Join(setting.RepositoryAvatarUploadPath, avatarstr) |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -237,12 +238,6 @@ func makeRepoResult(sRes *elastic.SearchResult, Key string, OnlyReturnNum bool) |
|
|
|
return returnObj |
|
|
|
} |
|
|
|
|
|
|
|
avatarPath := repo.CustomAvatarPath() |
|
|
|
if len(avatarPath) == 0 || !com.IsFile(avatarPath) { |
|
|
|
switch mode := setting.RepositoryAvatarFallback; mode { |
|
|
|
case "image": |
|
|
|
return setting.RepositoryAvatarFallbackImage |
|
|
|
|
|
|
|
func dealLongText(text string, Key string, MatchedQueries []string) string { |
|
|
|
var isNeedToDealText bool |
|
|
|
isNeedToDealText = false |
|
|
|
|