diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/src/main/java/org/terst/feedreader/data/AppDatabase.kt | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/app/src/main/java/org/terst/feedreader/data/AppDatabase.kt b/app/src/main/java/org/terst/feedreader/data/AppDatabase.kt index 2fd5816..e8ef3e0 100644 --- a/app/src/main/java/org/terst/feedreader/data/AppDatabase.kt +++ b/app/src/main/java/org/terst/feedreader/data/AppDatabase.kt @@ -12,7 +12,7 @@ private const val TAG = "FeedMigration" @Database( entities = [FeedEntity::class, ArticleEntity::class, FilterRuleEntity::class], - version = 10, + version = 11, exportSchema = false ) abstract class AppDatabase : RoomDatabase() { @@ -268,6 +268,28 @@ abstract class AppDatabase : RoomDatabase() { } } + // v11: seeds a MUTE rule for emptywheel's recurring "Fridays with Nicole Sandler" + // series (reported via the in-app bug report, 2026-08-22 -- each post is numbered, + // e.g. "-111", so a plain substring match on the un-numbered title part catches every + // installment going forward). Scoped to that one feed's id, not global, since the + // phrase itself is specific enough it'd only ever match that series anyway, and + // scoping costs nothing. Inserted directly rather than requiring the user to add it + // by hand in Settings, matching this file's existing pattern of shipping + // known-specific personal-data fixes as migrations (see v6-v9 above). + private val MIGRATION_10_11 = object : Migration(10, 11) { + override fun migrate(db: SupportSQLiteDatabase) { + db.execSQL( + "INSERT INTO filter_rules (pattern, action, feedId, createdAt) VALUES (?, ?, ?, ?)", + arrayOf( + "Fridays with Nicole Sandler", + FilterAction.MUTE.name, + "https://www.emptywheel.net/feed/", + System.currentTimeMillis() + ) + ) + } + } + fun get(context: Context): AppDatabase = instance ?: synchronized(this) { instance ?: Room.databaseBuilder( context.applicationContext, @@ -275,7 +297,8 @@ abstract class AppDatabase : RoomDatabase() { "feedreader.db" ).addMigrations( MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5, - MIGRATION_5_6, MIGRATION_6_7, MIGRATION_7_8, MIGRATION_8_9, MIGRATION_9_10 + MIGRATION_5_6, MIGRATION_6_7, MIGRATION_7_8, MIGRATION_8_9, MIGRATION_9_10, + MIGRATION_10_11 ).build().also { instance = it } } } |
