From c85903757df9f5dbbfeda0e070259f54eb243e6f Mon Sep 17 00:00:00 2001 From: Felix Date: Fri, 7 Sep 2018 08:34:49 +0200 Subject: [PATCH] start integrating 2.0.0 into touch --- build.gradle | 10 +++++----- common/build.gradle | 4 +--- .../nicidienase/chaosflix/common/ChaosflixDatabase.kt | 2 +- .../entities/recording/persistence/EventDao.kt | 5 ++++- .../common/mediadata/network/StreamingService.kt | 4 ++-- .../userdata/entities/download/OfflineEventDao.kt | 6 +++--- .../userdata/entities/watchlist/WatchlistItem.kt | 6 +++--- .../userdata/entities/watchlist/WatchlistItemDao.kt | 8 ++++---- 8 files changed, 23 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index df19b425..7f5ad89e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.2.50' + ext.kotlin_version = '1.2.61' repositories { jcenter() mavenCentral() @@ -29,14 +29,14 @@ allprojects { ext{ minSDK = 17 - targetSDK = 27 - compileSdkVersion = 27 - buildToolsVersion = "27.0.3" + targetSDK = 28 + compileSdkVersion = 28 + buildToolsVersion = "28.0.2" supportLibraryVersion = "27.1.1" constraintLayoutVersion = "1.0.2" archCompVersion = "1.1.1" - version="2.0.0-SNAPSHOT" + version="2.0.1-SNAPSHOT" } task clean(type: Delete) { diff --git a/common/build.gradle b/common/build.gradle index b87fd627..998310e2 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -42,10 +42,8 @@ dependencies { api "android.arch.lifecycle:common-java8:1.1.1" api "android.arch.persistence.room:runtime:${rootProject.ext.archCompVersion}" - api "android.arch.persistence.room:rxjava2:${rootProject.ext.archCompVersion}" kapt "android.arch.persistence.room:compiler:${rootProject.ext.archCompVersion}" - api 'com.squareup.retrofit2:retrofit:2.3.0' api 'com.squareup.retrofit2:converter-gson:2.3.0' @@ -56,7 +54,7 @@ dependencies { androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } repositories { diff --git a/common/src/main/java/de/nicidienase/chaosflix/common/ChaosflixDatabase.kt b/common/src/main/java/de/nicidienase/chaosflix/common/ChaosflixDatabase.kt index 86f987d0..5b0f696a 100644 --- a/common/src/main/java/de/nicidienase/chaosflix/common/ChaosflixDatabase.kt +++ b/common/src/main/java/de/nicidienase/chaosflix/common/ChaosflixDatabase.kt @@ -74,7 +74,7 @@ abstract class ChaosflixDatabase : RoomDatabase() { val migration_4_5 = object : Migration(4,5){ override fun migrate(database: SupportSQLiteDatabase) { - TODO("not implemented") +// TODO("not implemented") } } diff --git a/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/entities/recording/persistence/EventDao.kt b/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/entities/recording/persistence/EventDao.kt index 5cb8b331..eeee6ef0 100644 --- a/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/entities/recording/persistence/EventDao.kt +++ b/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/entities/recording/persistence/EventDao.kt @@ -18,6 +18,9 @@ interface EventDao: PersistentItemDao { @Query("SELECT * FROM event WHERE id = :id ORDER BY title ASC") fun findEventById(id: Long): LiveData + @Query("SELECT * FROM event WHERE guid = :guid LIMIT 1") + fun findEventByGuid(guid: String): LiveData + @Query("SELECT * FROM event WHERE id in (:ids)") fun findEventsByIds(ids: LongArray): LiveData> @@ -30,7 +33,7 @@ interface EventDao: PersistentItemDao { @Query("SELECT * FROM event WHERE conferenceId = :id ORDER BY title ASC") fun findEventsByConferenceSync(id: Long):List - @Query("SELECT * FROM event INNER JOIN watchlist_item WHERE event.id = watchlist_item.event_id") + @Query("SELECT * FROM event INNER JOIN watchlist_item WHERE event.guid = watchlist_item.event_guid") fun findBookmarkedEvents(): LiveData> @Query("SELECT * FROM event INNER JOIN playback_progress WHERE event.id = playback_progress.event_id") diff --git a/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/network/StreamingService.kt b/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/network/StreamingService.kt index a08b6268..ddd21fa0 100644 --- a/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/network/StreamingService.kt +++ b/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/network/StreamingService.kt @@ -1,11 +1,11 @@ package de.nicidienase.chaosflix.common.mediadata.network import de.nicidienase.chaosflix.common.mediadata.entities.streaming.LiveConference -import io.reactivex.Single +import retrofit2.Call import retrofit2.http.GET interface StreamingService { @GET("streams/v2.json") - fun getStreamingConferences(): Single> + fun getStreamingConferences(): Call> } diff --git a/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/download/OfflineEventDao.kt b/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/download/OfflineEventDao.kt index fc504273..f396b11b 100644 --- a/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/download/OfflineEventDao.kt +++ b/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/download/OfflineEventDao.kt @@ -12,16 +12,16 @@ interface OfflineEventDao{ fun insert(vararg items: OfflineEvent) @Query("SELECT * FROM offline_event WHERE event_guid = :guid LIMIT 1") - fun getByEventId(guid: String): LiveData + fun getByEventGuid(guid: String): LiveData @Query("SELECT * FROM offline_event WHERE event_guid = :guid LIMIT 1") - fun getByEventIdSynchronous(guid: String): OfflineEvent + fun getByEventGuidSynchronous(guid: String): OfflineEvent? @Query("SELECT * FROM offline_event WHERE download_reference = :ref LIMIT 1") fun getByDownloadReference(ref: Long): LiveData @Query("SELECT * FROM offline_event WHERE download_reference = :ref LIMIT 1") - fun getByDownloadReferenceSyncrounous(ref: Long): OfflineEvent + fun getByDownloadReferenceSyncrounous(ref: Long): OfflineEvent? @Query("SELECT * FROM offline_event") fun getAll(): LiveData> diff --git a/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/watchlist/WatchlistItem.kt b/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/watchlist/WatchlistItem.kt index 190cf79e..e3f71d43 100644 --- a/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/watchlist/WatchlistItem.kt +++ b/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/watchlist/WatchlistItem.kt @@ -6,8 +6,8 @@ import android.arch.persistence.room.Index import android.arch.persistence.room.PrimaryKey @Entity(tableName = "watchlist_item", - indices = arrayOf(Index(value = ["event_id"],unique = true))) + indices = arrayOf(Index(value = ["event_guid"], unique = true))) data class WatchlistItem(@PrimaryKey(autoGenerate = true) var id: Long = 0, - @ColumnInfo(name = "event_id") - var eventId: Long) + @ColumnInfo(name = "event_guid") + var eventGuid: String) diff --git a/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/watchlist/WatchlistItemDao.kt b/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/watchlist/WatchlistItemDao.kt index 807916a6..f318aedd 100644 --- a/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/watchlist/WatchlistItemDao.kt +++ b/common/src/main/java/de/nicidienase/chaosflix/common/userdata/entities/watchlist/WatchlistItemDao.kt @@ -9,8 +9,8 @@ interface WatchlistItemDao { @Query("SELECT * from watchlist_item") fun getAll(): LiveData> - @Query("SELECT * from watchlist_item WHERE event_id = :id LIMIT 1") - fun getItemForEvent(id: Long): LiveData + @Query("SELECT * from watchlist_item WHERE event_guid = :guid LIMIT 1") + fun getItemForEvent(guid: String): LiveData @Insert(onConflict = OnConflictStrategy.REPLACE) fun saveItem(item: WatchlistItem) @@ -18,6 +18,6 @@ interface WatchlistItemDao { @Delete fun deleteItem(item: WatchlistItem) - @Query("DELETE from watchlist_item WHERE event_id = :id") - fun deleteItem(id: Long) + @Query("DELETE from watchlist_item WHERE event_guid = :guid") + fun deleteItem(guid: String) } \ No newline at end of file