Remove unused Name value from SupportedFormat structs

This commit is contained in:
Seednode 2023-09-12 13:19:24 -05:00
parent c996f3fc53
commit d18dc9a41c
7 changed files with 3 additions and 11 deletions

View File

@ -12,7 +12,7 @@ import (
) )
const ( const (
ReleaseVersion string = "0.70.1" ReleaseVersion string = "0.70.2"
) )
var ( var (

View File

@ -10,7 +10,6 @@ import (
func RegisterAudioFormats() *SupportedFormat { func RegisterAudioFormats() *SupportedFormat {
return &SupportedFormat{ return &SupportedFormat{
Name: "audio",
Css: ``, Css: ``,
Title: func(queryParams, fileUri, filePath, fileName, mime string) string { Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
return fmt.Sprintf(`<title>%s</title>`, fileName) return fmt.Sprintf(`<title>%s</title>`, fileName)

View File

@ -11,7 +11,6 @@ import (
func RegisterFlashFormats() *SupportedFormat { func RegisterFlashFormats() *SupportedFormat {
return &SupportedFormat{ return &SupportedFormat{
Name: `flash`,
Css: ``, Css: ``,
Title: func(queryParams, fileUri, filePath, fileName, mime string) string { Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
return fmt.Sprintf(`<title>%s</title>`, fileName) return fmt.Sprintf(`<title>%s</title>`, fileName)

View File

@ -24,7 +24,6 @@ type Dimensions struct {
func RegisterImageFormats() *SupportedFormat { func RegisterImageFormats() *SupportedFormat {
return &SupportedFormat{ return &SupportedFormat{
Name: "images",
Css: ``, Css: ``,
Title: func(queryParams, fileUri, filePath, fileName, mime string) string { Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
dimensions, err := ImageDimensions(filePath) dimensions, err := ImageDimensions(filePath)

View File

@ -13,8 +13,7 @@ import (
func RegisterTextFormats() *SupportedFormat { func RegisterTextFormats() *SupportedFormat {
return &SupportedFormat{ return &SupportedFormat{
Name: "text", Css: `pre{margin:.5rem;}`,
Css: `pre{margin:.5rem;}`,
Title: func(queryParams, fileUri, filePath, fileName, mime string) string { Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
return fmt.Sprintf(`<title>%s</title>`, fileName) return fmt.Sprintf(`<title>%s</title>`, fileName)
}, },

View File

@ -12,7 +12,6 @@ import (
) )
type SupportedFormat struct { type SupportedFormat struct {
Name string
Css string Css string
Title func(queryParams, fileUri, filePath, fileName, mime string) string Title func(queryParams, fileUri, filePath, fileName, mime string) string
Body func(queryParams, fileUri, filePath, fileName, mime string) string Body func(queryParams, fileUri, filePath, fileName, mime string) string
@ -21,8 +20,6 @@ type SupportedFormat struct {
Validate func(filePath string) bool Validate func(filePath string) bool
} }
// func (s *SupportedFormat) ListExtensions() []string
type SupportedFormats struct { type SupportedFormats struct {
Extensions map[string]*SupportedFormat Extensions map[string]*SupportedFormat
MimeTypes map[string]*SupportedFormat MimeTypes map[string]*SupportedFormat

View File

@ -10,8 +10,7 @@ import (
func RegisterVideoFormats() *SupportedFormat { func RegisterVideoFormats() *SupportedFormat {
return &SupportedFormat{ return &SupportedFormat{
Name: "video", Css: ``,
Css: ``,
Title: func(queryParams, fileUri, filePath, fileName, mime string) string { Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
return fmt.Sprintf(`<title>%s</title>`, fileName) return fmt.Sprintf(`<title>%s</title>`, fileName)
}, },