Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ dependencies {
ksp(libs.room.compiler)

// bitfire libraries
implementation(libs.synctools)

// third-party libs
implementation(libs.mikepenz.aboutLibraries)
Expand All @@ -241,12 +240,7 @@ dependencies {
androidTestImplementation(libs.androidx.work.testing)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.room.testing)
androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.test.junit)
androidTestImplementation(libs.androidx.arch.core.testing)
androidTestImplementation(libs.kotlinx.coroutines.test)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.androidx.test.rules)

// Testing
testImplementation(libs.junit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class Ical4androidUtilTest {
"SUMMARY:Second entry\n" +
"END:VTODO\n" +
"END:VCALENDAR\n"
// The second VTODO shares the UID of the first; on import it is recognised as an already
// existing entry with an equal SEQUENCE and therefore skipped.
val num = Ical4androidUtil.insertFromReader(defaultTestAccount, context, defaultCollectionId!!, ics.reader())
assertEquals(2, num.first)
assertEquals(1, num.second)
Expand Down
19 changes: 19 additions & 0 deletions app/src/main/java/at/techbee/jtx/database/ICalDatabaseDao.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ import at.techbee.jtx.database.properties.COLUMN_CATEGORY_ICALOBJECT_ID
import at.techbee.jtx.database.properties.COLUMN_CATEGORY_TEXT
import at.techbee.jtx.database.properties.COLUMN_COMMENT_ICALOBJECT_ID
import at.techbee.jtx.database.properties.COLUMN_RELATEDTO_ICALOBJECT_ID
import at.techbee.jtx.database.properties.COLUMN_ORGANIZER_ICALOBJECT_ID
import at.techbee.jtx.database.properties.COLUMN_UNKNOWN_ICALOBJECT_ID
import at.techbee.jtx.database.properties.TABLE_NAME_ORGANIZER
import at.techbee.jtx.database.properties.TABLE_NAME_UNKNOWN
import at.techbee.jtx.database.properties.COLUMN_RELATEDTO_RELTYPE
import at.techbee.jtx.database.properties.COLUMN_RELATEDTO_TEXT
import at.techbee.jtx.database.properties.COLUMN_RESOURCE_ICALOBJECT_ID
Expand Down Expand Up @@ -360,6 +364,21 @@ interface ICalDatabaseDao {
@Query("SELECT * FROM $TABLE_NAME_ALARM WHERE $COLUMN_ALARM_ICALOBJECT_ID = :iCalObjectId")
fun getAlarmsSync(iCalObjectId: Long): List<Alarm>

@Query("SELECT * FROM $TABLE_NAME_ORGANIZER WHERE $COLUMN_ORGANIZER_ICALOBJECT_ID = :iCalObjectId LIMIT 1")
fun getOrganizerSync(iCalObjectId: Long): Organizer?

@Query("SELECT * FROM $TABLE_NAME_RELATEDTO WHERE $COLUMN_RELATEDTO_ICALOBJECT_ID = :iCalObjectId")
fun getRelatedtoSync(iCalObjectId: Long): List<Relatedto>

@Query("SELECT * FROM $TABLE_NAME_UNKNOWN WHERE $COLUMN_UNKNOWN_ICALOBJECT_ID = :iCalObjectId")
fun getUnknownSync(iCalObjectId: Long): List<Unknown>

@Query("SELECT $COLUMN_ID FROM $TABLE_NAME_ICALOBJECT WHERE $COLUMN_ICALOBJECT_COLLECTIONID = :collectionId")
fun getICalObjectIdsByCollectionSync(collectionId: Long): List<Long>

@Query("SELECT * FROM $TABLE_NAME_ICALOBJECT WHERE $COLUMN_UID = :uid AND $COLUMN_RECURID IS NULL LIMIT 1")
fun getICalObjectByUidSync(uid: String): ICalObject?

/**
* Returns a list of (distinct) ICalObjects that have an active alarm
* (an alarm, that was already triggered but not removed)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/at/techbee/jtx/database/ICalObject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.PrimaryKey
import at.bitfire.ical4android.util.TimeApiExtensions.toLocalDate
import at.techbee.jtx.util.toLocalDate
import at.techbee.jtx.R
import at.techbee.jtx.contract.JtxContract
import at.techbee.jtx.ui.settings.DropdownSettingOption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import at.bitfire.synctools.util.AndroidTimeUtils.toTimestamp
import at.techbee.jtx.util.toTimestamp
import at.techbee.jtx.R
import at.techbee.jtx.database.ICalObject
import at.techbee.jtx.database.ICalObject.Companion.TZ_ALLDAY
Expand Down
Loading
Loading