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

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