Fix migration and API issue

pull/1775/head
Alex Baker 3 years ago
parent 762ae3dc59
commit 5907cae106

@ -22,7 +22,6 @@ import at.bitfire.dav4jvm.property.GetETag
import at.bitfire.dav4jvm.property.GetETag.Companion.fromResponse
import at.bitfire.dav4jvm.property.SyncToken
import at.bitfire.ical4android.ICalendar.Companion.prodId
import com.todoroo.astrid.alarms.AlarmService
import com.todoroo.astrid.dao.TaskDao
import com.todoroo.astrid.data.Task
import com.todoroo.astrid.helper.UUIDHelper
@ -93,7 +92,6 @@ class CaldavSynchronizer @Inject constructor(
private val provider: CaldavClientProvider,
private val iCal: iCalendar,
private val principalDao: PrincipalDao,
private val alarmService: AlarmService,
) {
suspend fun sync(account: CaldavAccount) {
Thread.currentThread().contextClassLoader = context.classLoader

@ -72,5 +72,5 @@ internal fun VAlarm.toAlarm(): Alarm? {
private fun net.fortuna.ical4j.model.property.Duration.toMillis() = duration.toMillis()
private fun TemporalAmount.toMillis() = toDuration(Instant.EPOCH).toSeconds() * 1_000
private fun TemporalAmount.toMillis() = toDuration(Instant.EPOCH).toMillis()

@ -427,7 +427,7 @@ object Migrations {
"INSERT INTO `alarms` (`task`, `time`, `type`, `repeat`, `interval`) SELECT `_id`, ${HOURS.toMillis(24)}, $TYPE_REL_END, 6, ${HOURS.toMillis(24)} FROM `tasks` WHERE `dueDate` > 0 AND `notificationFlags` | $NOTIFY_AFTER_DEADLINE"
)
database.execSQL(
"INSERT INTO `alarms` (`task`, `time`, `type`) SELECT `_id`, `task.notifications`, $TYPE_RANDOM FROM `tasks` WHERE `notifications` > 0"
"INSERT INTO `alarms` (`task`, `time`, `type`) SELECT `_id`, `notifications`, $TYPE_RANDOM FROM `tasks` WHERE `notifications` > 0"
)
database.execSQL(
"INSERT INTO `alarms` (`task`, `time`, `type`) SELECT `_id`, `snoozeTime`, $TYPE_SNOOZE FROM `tasks` WHERE `snoozeTime` > 0"

Loading…
Cancel
Save