if an ics file event contains multiple categories, use the first one
This commit is contained in:
parent
6d93a7def5
commit
da75540321
|
@ -155,16 +155,19 @@ class IcsParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun tryAddCategories(categories: String, context: Context) {
|
private fun tryAddCategories(categories: String, context: Context) {
|
||||||
if (!categories.contains(",")) {
|
val eventTypeTitle = if (categories.contains(",")) {
|
||||||
val eventTitle = categories
|
categories.split(",")[0]
|
||||||
val dbHelper = DBHelper.newInstance(context)
|
} else {
|
||||||
val eventId = dbHelper.getEventTypeIdWithTitle(eventTitle)
|
categories
|
||||||
if (eventId == -1) {
|
}
|
||||||
val eventType = EventType(0, eventTitle, context.resources.getColor(R.color.color_primary))
|
|
||||||
curEventType = dbHelper.insertEventType(eventType)
|
val dbHelper = DBHelper.newInstance(context)
|
||||||
} else {
|
val eventId = dbHelper.getEventTypeIdWithTitle(eventTypeTitle)
|
||||||
curEventType = eventId
|
if (eventId == -1) {
|
||||||
}
|
val eventType = EventType(0, eventTypeTitle, context.resources.getColor(R.color.color_primary))
|
||||||
|
curEventType = dbHelper.insertEventType(eventType)
|
||||||
|
} else {
|
||||||
|
curEventType = eventId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue