diff --git a/app/schemas/com.battlelancer.seriesguide.provider.SgRoomDatabase/52.json b/app/schemas/com.battlelancer.seriesguide.provider.SgRoomDatabase/52.json index 06cecf1a10..17d344124d 100644 --- a/app/schemas/com.battlelancer.seriesguide.provider.SgRoomDatabase/52.json +++ b/app/schemas/com.battlelancer.seriesguide.provider.SgRoomDatabase/52.json @@ -2,7 +2,7 @@ "formatVersion": 1, "database": { "version": 52, - "identityHash": "9673c86af9da24ea4d043f602f71b9ee", + "identityHash": "370f7a37b1f61520657ec12a805f3b9f", "entities": [ { "tableName": "series", @@ -1472,7 +1472,7 @@ }, { "tableName": "sg_watch_provider", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `provider_id` INTEGER NOT NULL, `provider_name` TEXT NOT NULL, `display_priority` INTEGER NOT NULL, `logo_path` TEXT NOT NULL, `type` INTEGER NOT NULL, `enabled` INTEGER NOT NULL)", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `provider_id` INTEGER NOT NULL, `provider_name` TEXT NOT NULL, `display_priority` INTEGER NOT NULL, `logo_path` TEXT NOT NULL, `type` INTEGER NOT NULL, `enabled` INTEGER NOT NULL, `filter_local` INTEGER NOT NULL DEFAULT false)", "fields": [ { "fieldPath": "_id", @@ -1515,6 +1515,13 @@ "columnName": "enabled", "affinity": "INTEGER", "notNull": true + }, + { + "fieldPath": "filter_local", + "columnName": "filter_local", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "false" } ], "primaryKey": { @@ -1604,7 +1611,7 @@ "views": [], "setupQueries": [ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", - "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '9673c86af9da24ea4d043f602f71b9ee')" + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '370f7a37b1f61520657ec12a805f3b9f')" ] } } \ No newline at end of file diff --git a/app/src/main/java/com/battlelancer/seriesguide/provider/SgRoomDatabase.kt b/app/src/main/java/com/battlelancer/seriesguide/provider/SgRoomDatabase.kt index 9694762fb8..73da1f88d5 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/provider/SgRoomDatabase.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/provider/SgRoomDatabase.kt @@ -62,7 +62,7 @@ import timber.log.Timber ), AutoMigration( from = SgRoomDatabase.VERSION_51_CUSTOM_RELEASE_TIME, - to = SgRoomDatabase.VERSION_52_PROVIDER_AND_GENRE_FILTERS + to = SgRoomDatabase.VERSION_52_WATCH_PROVIDER_FILTERS ) ] ) @@ -123,8 +123,13 @@ abstract class SgRoomDatabase : RoomDatabase() { * Add custom release time, day offset and time zone to shows. */ const val VERSION_51_CUSTOM_RELEASE_TIME = 51 - const val VERSION_52_PROVIDER_AND_GENRE_FILTERS = 52 - const val VERSION = VERSION_52_PROVIDER_AND_GENRE_FILTERS + + /** + * - Add [SgWatchProviderShowMapping] + * - Add [SgWatchProvider.filter_local] + */ + const val VERSION_52_WATCH_PROVIDER_FILTERS = 52 + const val VERSION = VERSION_52_WATCH_PROVIDER_FILTERS @Volatile private var instance: SgRoomDatabase? = null diff --git a/app/src/main/java/com/battlelancer/seriesguide/streaming/SgWatchProvider.kt b/app/src/main/java/com/battlelancer/seriesguide/streaming/SgWatchProvider.kt index 84915f3ce9..44a9786d1b 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/streaming/SgWatchProvider.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/streaming/SgWatchProvider.kt @@ -3,6 +3,7 @@ package com.battlelancer.seriesguide.streaming +import androidx.room.ColumnInfo import androidx.room.Entity import androidx.room.Index import androidx.room.PrimaryKey @@ -29,7 +30,17 @@ data class SgWatchProvider( * to duplicates, but allows a different enabled set for shows than for movies. */ val type: Int, - val enabled: Boolean + /** + * If discover results should be filtered by this provider. + */ + val enabled: Boolean, + /** + * If local shows or movies should be filtered by this provider. + * + * Added with [com.battlelancer.seriesguide.provider.SgRoomDatabase.VERSION_52_WATCH_PROVIDER_FILTERS]. + */ + @ColumnInfo(defaultValue = "false") + val filter_local: Boolean = false ) { enum class Type(val id: Int) { SHOWS(1),