Lone category

This commit is contained in:
Peter Stuifzand 2018-04-07 21:04:29 +02:00
parent 75c9dfd4f6
commit e850e7f923

View File

@ -232,9 +232,14 @@ func mapToItem(result map[string]interface{}) microsub.Item {
}
if value, e := result["category"]; e {
item.Category = value.([]string)
for _, v := range value.([]interface{}) {
item.Category = append(item.Category, v.(string))
if cats, ok := value.([]string); ok {
item.Category = value.([]string)
for _, v := range value.([]interface{}) {
item.Category = append(item.Category, v.(string))
}
} else {
item.Category = value.(string)
}
}