start integrating 2.0.0 into touch

This commit is contained in:
Felix 2018-09-07 08:34:49 +02:00
parent 76a2a204a8
commit c85903757d
8 changed files with 23 additions and 22 deletions

View file

@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.2.50' ext.kotlin_version = '1.2.61'
repositories { repositories {
jcenter() jcenter()
mavenCentral() mavenCentral()
@ -29,14 +29,14 @@ allprojects {
ext{ ext{
minSDK = 17 minSDK = 17
targetSDK = 27 targetSDK = 28
compileSdkVersion = 27 compileSdkVersion = 28
buildToolsVersion = "27.0.3" buildToolsVersion = "28.0.2"
supportLibraryVersion = "27.1.1" supportLibraryVersion = "27.1.1"
constraintLayoutVersion = "1.0.2" constraintLayoutVersion = "1.0.2"
archCompVersion = "1.1.1" archCompVersion = "1.1.1"
version="2.0.0-SNAPSHOT" version="2.0.1-SNAPSHOT"
} }
task clean(type: Delete) { task clean(type: Delete) {

View file

@ -42,10 +42,8 @@ dependencies {
api "android.arch.lifecycle:common-java8:1.1.1" api "android.arch.lifecycle:common-java8:1.1.1"
api "android.arch.persistence.room:runtime:${rootProject.ext.archCompVersion}" 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}" kapt "android.arch.persistence.room:compiler:${rootProject.ext.archCompVersion}"
api 'com.squareup.retrofit2:retrofit:2.3.0' api 'com.squareup.retrofit2:retrofit:2.3.0'
api 'com.squareup.retrofit2:converter-gson: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', { androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations' 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 { repositories {

View file

@ -74,7 +74,7 @@ abstract class ChaosflixDatabase : RoomDatabase() {
val migration_4_5 = object : Migration(4,5){ val migration_4_5 = object : Migration(4,5){
override fun migrate(database: SupportSQLiteDatabase) { override fun migrate(database: SupportSQLiteDatabase) {
TODO("not implemented") // TODO("not implemented")
} }
} }

View file

@ -18,6 +18,9 @@ interface EventDao: PersistentItemDao<PersistentEvent> {
@Query("SELECT * FROM event WHERE id = :id ORDER BY title ASC") @Query("SELECT * FROM event WHERE id = :id ORDER BY title ASC")
fun findEventById(id: Long): LiveData<PersistentEvent> fun findEventById(id: Long): LiveData<PersistentEvent>
@Query("SELECT * FROM event WHERE guid = :guid LIMIT 1")
fun findEventByGuid(guid: String): LiveData<PersistentEvent>
@Query("SELECT * FROM event WHERE id in (:ids)") @Query("SELECT * FROM event WHERE id in (:ids)")
fun findEventsByIds(ids: LongArray): LiveData<List<PersistentEvent>> fun findEventsByIds(ids: LongArray): LiveData<List<PersistentEvent>>
@ -30,7 +33,7 @@ interface EventDao: PersistentItemDao<PersistentEvent> {
@Query("SELECT * FROM event WHERE conferenceId = :id ORDER BY title ASC") @Query("SELECT * FROM event WHERE conferenceId = :id ORDER BY title ASC")
fun findEventsByConferenceSync(id: Long):List<PersistentEvent> fun findEventsByConferenceSync(id: Long):List<PersistentEvent>
@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<List<PersistentEvent>> fun findBookmarkedEvents(): LiveData<List<PersistentEvent>>
@Query("SELECT * FROM event INNER JOIN playback_progress WHERE event.id = playback_progress.event_id") @Query("SELECT * FROM event INNER JOIN playback_progress WHERE event.id = playback_progress.event_id")

View file

@ -1,11 +1,11 @@
package de.nicidienase.chaosflix.common.mediadata.network package de.nicidienase.chaosflix.common.mediadata.network
import de.nicidienase.chaosflix.common.mediadata.entities.streaming.LiveConference import de.nicidienase.chaosflix.common.mediadata.entities.streaming.LiveConference
import io.reactivex.Single import retrofit2.Call
import retrofit2.http.GET import retrofit2.http.GET
interface StreamingService { interface StreamingService {
@GET("streams/v2.json") @GET("streams/v2.json")
fun getStreamingConferences(): Single<List<LiveConference>> fun getStreamingConferences(): Call<List<LiveConference>>
} }

View file

@ -12,16 +12,16 @@ interface OfflineEventDao{
fun insert(vararg items: OfflineEvent) fun insert(vararg items: OfflineEvent)
@Query("SELECT * FROM offline_event WHERE event_guid = :guid LIMIT 1") @Query("SELECT * FROM offline_event WHERE event_guid = :guid LIMIT 1")
fun getByEventId(guid: String): LiveData<OfflineEvent> fun getByEventGuid(guid: String): LiveData<OfflineEvent>
@Query("SELECT * FROM offline_event WHERE event_guid = :guid LIMIT 1") @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") @Query("SELECT * FROM offline_event WHERE download_reference = :ref LIMIT 1")
fun getByDownloadReference(ref: Long): LiveData<OfflineEvent> fun getByDownloadReference(ref: Long): LiveData<OfflineEvent>
@Query("SELECT * FROM offline_event WHERE download_reference = :ref LIMIT 1") @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") @Query("SELECT * FROM offline_event")
fun getAll(): LiveData<List<OfflineEvent>> fun getAll(): LiveData<List<OfflineEvent>>

View file

@ -6,8 +6,8 @@ import android.arch.persistence.room.Index
import android.arch.persistence.room.PrimaryKey import android.arch.persistence.room.PrimaryKey
@Entity(tableName = "watchlist_item", @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) data class WatchlistItem(@PrimaryKey(autoGenerate = true)
var id: Long = 0, var id: Long = 0,
@ColumnInfo(name = "event_id") @ColumnInfo(name = "event_guid")
var eventId: Long) var eventGuid: String)

View file

@ -9,8 +9,8 @@ interface WatchlistItemDao {
@Query("SELECT * from watchlist_item") @Query("SELECT * from watchlist_item")
fun getAll(): LiveData<List<WatchlistItem>> fun getAll(): LiveData<List<WatchlistItem>>
@Query("SELECT * from watchlist_item WHERE event_id = :id LIMIT 1") @Query("SELECT * from watchlist_item WHERE event_guid = :guid LIMIT 1")
fun getItemForEvent(id: Long): LiveData<WatchlistItem> fun getItemForEvent(guid: String): LiveData<WatchlistItem>
@Insert(onConflict = OnConflictStrategy.REPLACE) @Insert(onConflict = OnConflictStrategy.REPLACE)
fun saveItem(item: WatchlistItem) fun saveItem(item: WatchlistItem)
@ -18,6 +18,6 @@ interface WatchlistItemDao {
@Delete @Delete
fun deleteItem(item: WatchlistItem) fun deleteItem(item: WatchlistItem)
@Query("DELETE from watchlist_item WHERE event_id = :id") @Query("DELETE from watchlist_item WHERE event_guid = :guid")
fun deleteItem(id: Long) fun deleteItem(guid: String)
} }