mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-14 23:33:02 -06:00
Remove unnecessary storage config variables (#344)
* rewire config to not use extraneous serve vars * rename 'file' to 'local' for consistency * use Type and Size again
This commit is contained in:
parent
2582515b4d
commit
cb8688f429
51 changed files with 310 additions and 408 deletions
|
|
@ -295,28 +295,28 @@ type imageAndMeta struct {
|
|||
|
||||
// ParseMediaType converts s to a recognized MediaType, or returns an error if unrecognized
|
||||
func ParseMediaType(s string) (Type, error) {
|
||||
switch Type(s) {
|
||||
case Attachment:
|
||||
return Attachment, nil
|
||||
case Header:
|
||||
return Header, nil
|
||||
case Avatar:
|
||||
return Avatar, nil
|
||||
case Emoji:
|
||||
return Emoji, nil
|
||||
switch s {
|
||||
case string(TypeAttachment):
|
||||
return TypeAttachment, nil
|
||||
case string(TypeHeader):
|
||||
return TypeHeader, nil
|
||||
case string(TypeAvatar):
|
||||
return TypeAvatar, nil
|
||||
case string(TypeEmoji):
|
||||
return TypeEmoji, nil
|
||||
}
|
||||
return "", fmt.Errorf("%s not a recognized MediaType", s)
|
||||
}
|
||||
|
||||
// ParseMediaSize converts s to a recognized MediaSize, or returns an error if unrecognized
|
||||
func ParseMediaSize(s string) (Size, error) {
|
||||
switch Size(s) {
|
||||
case Small:
|
||||
return Small, nil
|
||||
case Original:
|
||||
return Original, nil
|
||||
case Static:
|
||||
return Static, nil
|
||||
switch s {
|
||||
case string(SizeSmall):
|
||||
return SizeSmall, nil
|
||||
case string(SizeOriginal):
|
||||
return SizeOriginal, nil
|
||||
case string(SizeStatic):
|
||||
return SizeStatic, nil
|
||||
}
|
||||
return "", fmt.Errorf("%s not a recognized MediaSize", s)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue