1
Fork 0

Fix bug causing mediatype to always be Photo

This commit is contained in:
viktorstrate 2021-04-17 17:51:13 +02:00
parent 7f885fa63e
commit f6f7377096
No known key found for this signature in database
GPG Key ID: 3F855605109C1E8A
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ func (m *Media) AfterFind(tx *gorm.DB) error {
lowercasedType := strings.ToLower(string(m.Type))
foundType := false
for _, t := range AllMediaType {
if strings.ToLower(string(m.Type)) == lowercasedType {
if strings.ToLower(string(t)) == lowercasedType {
m.Type = t
foundType = true
break