chore: upgrade version 0.13.1 (#1754)

This commit is contained in:
boojack
2023-05-27 09:09:41 +08:00
committed by GitHub
parent 93d608f050
commit 2e34ce90a1
16 changed files with 48 additions and 303 deletions

View File

@ -123,6 +123,7 @@ func (s *Server) registerResourceRoutes(g *echo.Group) {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to unmarshal storage service id").SetInternal(err)
}
}
publicID := common.GenUUID()
if storageServiceID == api.DatabaseStorage {
fileBytes, err := io.ReadAll(sourceFile)
@ -326,11 +327,12 @@ func (s *Server) registerResourceRoutes(g *echo.Group) {
if err := os.Remove(resource.InternalPath); err != nil {
log.Warn(fmt.Sprintf("failed to delete local file with path %s", resource.InternalPath), zap.Error(err))
}
}
thumbnailPath := path.Join(s.Profile.Data, thumbnailImagePath, resource.PublicID)
if err := os.Remove(thumbnailPath); err != nil {
log.Warn(fmt.Sprintf("failed to delete local thumbnail with path %s", thumbnailPath), zap.Error(err))
}
ext := filepath.Ext(resource.Filename)
thumbnailPath := path.Join(s.Profile.Data, thumbnailImagePath, fmt.Sprintf("%d-%s%s", resource.ID, resource.PublicID, ext))
if err := os.Remove(thumbnailPath); err != nil {
log.Warn(fmt.Sprintf("failed to delete local thumbnail with path %s", thumbnailPath), zap.Error(err))
}
resourceDelete := &api.ResourceDelete{
@ -434,7 +436,7 @@ func (s *Server) registerResourcePublicRoutes(g *echo.Group) {
if c.QueryParam("thumbnail") == "1" && common.HasPrefixes(resource.Type, "image/png", "image/jpeg") {
ext := filepath.Ext(filename)
thumbnailPath := path.Join(s.Profile.Data, thumbnailImagePath, resource.PublicID+ext)
thumbnailPath := path.Join(s.Profile.Data, thumbnailImagePath, fmt.Sprintf("%d-%s%s", resource.ID, resource.PublicID, ext))
thumbnailBlob, err := getOrGenerateThumbnailImage(blob, thumbnailPath)
if err != nil {
log.Warn(fmt.Sprintf("failed to get or generate local thumbnail with path %s", thumbnailPath), zap.Error(err))

View File

@ -9,10 +9,10 @@ import (
// Version is the service current released version.
// Semantic versioning: https://semver.org/
var Version = "0.13.0"
var Version = "0.13.1"
// DevVersion is the service current development version.
var DevVersion = "0.13.0"
var DevVersion = "0.13.1"
func GetCurrentVersion(mode string) string {
if mode == "dev" || mode == "demo" {