Skip to content

Commit

Permalink
chore: upgrade version 0.13.1 (#1754)
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack authored May 27, 2023
1 parent 93d608f commit 2e34ce9
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 303 deletions.
66 changes: 0 additions & 66 deletions .github/workflows/e2e-test.yml

This file was deleted.

12 changes: 7 additions & 5 deletions server/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions server/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
1 change: 0 additions & 1 deletion store/db/migration/prod/0.12/04__resource_public_id.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ALTER TABLE
ADD
COLUMN public_id TEXT NOT NULL DEFAULT '';

-- TODO(steven): remove this in next release.
CREATE UNIQUE INDEX resource_id_public_id_unique_index ON resource (id, public_id);

UPDATE
Expand Down
5 changes: 5 additions & 0 deletions store/memo.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"strconv"
"strings"
"time"

"github.com/usememos/memos/common"
)
Expand Down Expand Up @@ -90,6 +91,10 @@ func (s *Store) CreateMemo(ctx context.Context, create *MemoMessage) (*MemoMessa
}
defer tx.Rollback()

if create.CreatedTs == 0 {
create.CreatedTs = time.Now().Unix()
}

query := `
INSERT INTO memo (
creator_id,
Expand Down
13 changes: 0 additions & 13 deletions web/e2e-tests/001-setup.spec.ts

This file was deleted.

37 changes: 0 additions & 37 deletions web/e2e-tests/002-basic.spec.ts

This file was deleted.

2 changes: 0 additions & 2 deletions web/e2e-tests/fixtures.ts

This file was deleted.

52 changes: 0 additions & 52 deletions web/e2e-tests/utils.ts

This file was deleted.

1 change: 0 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"zustand": "^4.3.6"
},
"devDependencies": {
"@playwright/test": "^1.32.2",
"@types/lodash-es": "^4.17.5",
"@types/node": "^18.0.3",
"@types/qs": "^6.9.7",
Expand Down
19 changes: 0 additions & 19 deletions web/playwright.config.ts

This file was deleted.

20 changes: 0 additions & 20 deletions web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2e34ce9

Please sign in to comment.