Commit 8fbf4076 authored by Ricki Hirner's avatar Ricki Hirner 🐑

ical4android: unify VEVENT/VTODO parsing

parent 7f25c3a0
......@@ -60,7 +60,7 @@ class ProcessEventsTask(
override fun onSuccess(data: InputStream, contentType: MediaType?, eTag: String?, lastModified: Long?) {
InputStreamReader(data, contentType?.charset() ?: Charsets.UTF_8).use { reader ->
try {
val events = Event.fromReader(reader)
val events = Event.eventsFromReader(reader)
processEvents(events)
Log.i(Constants.TAG, "Calendar sync successful, ETag=$eTag, lastModified=$lastModified")
......
......@@ -20,6 +20,7 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import at.bitfire.ical4android.Event
import at.bitfire.ical4android.ICalendar
import at.bitfire.icsdroid.CalendarFetcher
import at.bitfire.icsdroid.Constants
import at.bitfire.icsdroid.HttpClient
......@@ -110,12 +111,12 @@ class AddCalendarValidationFragment: DialogFragment() {
override fun onSuccess(data: InputStream, contentType: MediaType?, eTag: String?, lastModified: Long?) {
InputStreamReader(data, contentType?.charset() ?: Charsets.UTF_8).use { reader ->
val properties = mutableMapOf<String, String>()
val events = Event.fromReader(reader, properties)
val events = Event.eventsFromReader(reader, properties)
// URL may have changed because of redirects
info.url = url
info.calendarName = properties[Event.CALENDAR_NAME]
info.calendarName = properties[ICalendar.CALENDAR_NAME]
info.eventsFound = events.size
}
......
Subproject commit 9459f80ddf32dec83969848428b949a649ff2502
Subproject commit e6cca0765812cc62a17af2ade98c55f983410d11
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment