resolve comments

pull/3234/head
Aaron Liu 1 week ago
parent d06a29e8a3
commit daba550ea7

@ -3,9 +3,10 @@ package inventory
import (
"context"
"fmt"
"github.com/cloudreve/Cloudreve/v4/inventory/types"
"time"
"github.com/cloudreve/Cloudreve/v4/inventory/types"
"entgo.io/ent/dialect/sql"
"github.com/cloudreve/Cloudreve/v4/ent"
"github.com/cloudreve/Cloudreve/v4/ent/file"
@ -23,14 +24,6 @@ type (
LoadShareUser struct{}
)
// WithShareEagerLoad returns a context with share eager loading options enabled.
// This loads the share's associated user and file when querying.
func WithShareEagerLoad(ctx context.Context) context.Context {
ctx = context.WithValue(ctx, LoadShareUser{}, true)
ctx = context.WithValue(ctx, LoadShareFile{}, true)
return ctx
}
var (
ErrShareLinkExpired = fmt.Errorf("share link expired")
ErrOwnerInactive = fmt.Errorf("owner is inactive")

@ -166,7 +166,7 @@ func renderShareOGPage(c *gin.Context, dep dependency.Dep, id, password string)
data.Title = shareInfo.Name
if shareInfo.SourceType != nil && *shareInfo.SourceType == types.FileTypeFolder {
data.Description = "Folder"
} else {
} else if shareInfo.Unlocked {
data.Description = formatFileSize(shareInfo.Size)
thumbnail, err := loadShareThumbnail(c, id, password, shareInfo)
if err == nil {

Loading…
Cancel
Save