|
|
@ -728,6 +728,14 @@ func (a AppService) GetAppUpdate() (*response.AppUpdateRes, error) { |
|
|
|
res.CanUpdate = true |
|
|
|
res.CanUpdate = true |
|
|
|
return res, err |
|
|
|
return res, err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
apps, _ := appRepo.GetBy(appRepo.WithResource(constant.AppResourceRemote)) |
|
|
|
|
|
|
|
for _, app := range apps { |
|
|
|
|
|
|
|
if app.Icon == "" { |
|
|
|
|
|
|
|
res.CanUpdate = true |
|
|
|
|
|
|
|
return res, err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
list, err := getAppList() |
|
|
|
list, err := getAppList() |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return res, err |
|
|
|
return res, err |
|
|
@ -836,12 +844,16 @@ func (a AppService) SyncAppListFromRemote() (err error) { |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
defer iconRes.Body.Close() |
|
|
|
|
|
|
|
body, err := io.ReadAll(iconRes.Body) |
|
|
|
body, err := io.ReadAll(iconRes.Body) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
iconStr := base64.StdEncoding.EncodeToString(body) |
|
|
|
iconStr := "" |
|
|
|
|
|
|
|
if !strings.Contains(string(body), "xml") { |
|
|
|
|
|
|
|
iconStr = base64.StdEncoding.EncodeToString(body) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
_ = iconRes.Body.Close() |
|
|
|
|
|
|
|
|
|
|
|
app.Icon = iconStr |
|
|
|
app.Icon = iconStr |
|
|
|
app.TagsKey = l.AppProperty.Tags |
|
|
|
app.TagsKey = l.AppProperty.Tags |
|
|
|
if l.AppProperty.Recommend > 0 { |
|
|
|
if l.AppProperty.Recommend > 0 { |
|
|
|