use simpler FahrplanLecture for importing favorites

This commit is contained in:
Felix 2020-01-03 17:30:50 +01:00
parent cca71e499d
commit c14df7e961
2 changed files with 13 additions and 38 deletions

View file

@ -1,35 +1,10 @@
package de.nicidienase.chaosflix.common.eventimport
import com.google.gson.annotations.SerializedName
data class FahrplanLecture(
var lectureId: String = "",
var lectureId: String? = null,
var title: String,
var subtitle: String = "",
var day: Int = 0,
var room: String? = null,
var slug: String? = null,
var url: String? = null,
var startTime: Int = 0,
var duration: Int = 0,
var speakers: String? = null,
var track: String? = null,
var type: String? = null,
var lang: String? = null,
@SerializedName("abstractt")
var abstract: String = "",
var description: String = "",
var relStartTime: Int = 0,
var subtitle: String? = null,
var links: String? = null,
var date: String? = null,
var dateUTC: Long = 0,
var roomIndex: Int = 0,
var recordingLicense: String? = null,
var recordingOptOut: Boolean = false
) {
companion object {
val RECORDING_OPTOUT_ON = true
val RECORDING_OPTOUT_OFF = false
}
}
var track: String? = null,
var description: String? = null
)

View file

@ -60,16 +60,16 @@ class FavoritesImportViewModel(
}
}
private suspend fun updateConferences(conference: String) {
private suspend fun updateConferences(conferenceName: String) {
val fahrplanMappings = mappingService.getFahrplanMappings()
Log.d(TAG, "Updating conferences for $conference, mappings=$fahrplanMappings")
if (fahrplanMappings.containsKey(conference)) {
fahrplanMappings[conference]?.let { keys ->
for (conf in keys) {
conferenceDao.findConferenceByAcronymSync(conf)?.let { conf ->
Log.d(TAG, "Updating conferences for $conferenceName, mappings=$fahrplanMappings")
if (fahrplanMappings.containsKey(conferenceName)) {
fahrplanMappings[conferenceName]?.let { keys ->
for (conferenceAcronym in keys) {
conferenceDao.findConferenceByAcronymSync(conferenceAcronym)?.let { conference ->
val list =
downloader.updateEventsForConferencesSuspending(conf)
Log.d(TAG, "updated ${conf.acronym}, got ${list.size} events")
downloader.updateEventsForConferencesSuspending(conference)
Log.d(TAG, "updated ${conference.acronym}, got ${list.size} events")
}
}
}