Rename "Trending" to "TrendingTags" or similar where necessary (#3906)

The "trending" functionality will expand to include trending links and
posts. But at the moment the "Trending" references in the code are
exclusively to hashtags.

Rename "Trending" to "TrendingTags" or similar everywhere necessary in
order to prepare for this.

This includes a database migration, as the identifier for the "Trending
tags" tab in the account preferences was changed from "Trending" to
"TrendingTags". The migration updates the stored value if necessary.
This commit is contained in:
Nik Clayton 2023-08-19 12:54:35 +02:00 committed by GitHub
commit b6102a755a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1077 additions and 57 deletions

View file

@ -42,12 +42,12 @@ import java.io.File;
TimelineAccountEntity.class,
ConversationEntity.class
},
version = 52,
version = 53,
autoMigrations = {
@AutoMigration(from = 48, to = 49),
@AutoMigration(from = 49, to = 50, spec = AppDatabase.MIGRATION_49_50.class),
@AutoMigration(from = 50, to = 51),
@AutoMigration(from = 51, to = 52)
@AutoMigration(from = 51, to = 52),
}
)
public abstract class AppDatabase extends RoomDatabase {
@ -674,4 +674,15 @@ public abstract class AppDatabase extends RoomDatabase {
@DeleteColumn(tableName = "AccountEntity", columnName = "activeNotifications")
static class MIGRATION_49_50 implements AutoMigrationSpec { }
/**
* TabData.TRENDING was renamed to TabData.TRENDING_TAGS, and the text
* representation was changed from "Trending" to "TrendingTags".
*/
public static final Migration MIGRATION_52_53 = new Migration(52, 53) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("UPDATE `AccountEntity` SET `tabpreferences` = REPLACE(tabpreferences, 'Trending:', 'TrendingTags:')");
}
};
}