feat(fs): custom properties for files (#2407)

This commit is contained in:
Aaron Liu
2025-07-12 11:15:33 +08:00
parent b13490357b
commit 3cda4d1ef7
9 changed files with 252 additions and 39 deletions

View File

@@ -196,6 +196,8 @@ type (
LibRawThumbExts(ctx context.Context) []string
// LibRawThumbPath returns the path of libraw executable.
LibRawThumbPath(ctx context.Context) string
// CustomProps returns the custom props settings.
CustomProps(ctx context.Context) []types.CustomProps
}
UseFirstSiteUrlCtxKey = struct{}
)
@@ -223,6 +225,15 @@ type (
}
)
func (s *settingProvider) CustomProps(ctx context.Context) []types.CustomProps {
raw := s.getString(ctx, "custom_props", "[]")
var props []types.CustomProps
if err := json.Unmarshal([]byte(raw), &props); err != nil {
return []types.CustomProps{}
}
return props
}
func (s *settingProvider) License(ctx context.Context) string {
return s.getString(ctx, "license", "")
}