cleanedTabs = tabs.stream()
+ .filter(tab -> !(tab instanceof Tab.KioskTab kioskTab
+ && kioskTab.getKioskServiceId() == SoundCloud.getServiceId()
+ && kioskTab.getKioskId().equals("Top 50")))
+ .collect(Collectors.toUnmodifiableList());
+ if (tabs.size() != cleanedTabs.size()) {
+ tabsManager.saveTabs(cleanedTabs);
+ // create an AlertDialog to inform the user about the change
+ MIGRATION_INFO.add((Context uiContext) -> new AlertDialog.Builder(uiContext)
+ .setTitle(R.string.migration_info_6_7_title)
+ .setMessage(R.string.migration_info_6_7_message)
+ .setPositiveButton(R.string.ok, null)
+ .setCancelable(false)
+ .create()
+ .show());
+ }
+ }
+ };
+
/**
* List of all implemented migrations.
*
@@ -156,12 +196,13 @@ public final class SettingMigrations {
MIGRATION_3_4,
MIGRATION_4_5,
MIGRATION_5_6,
+ MIGRATION_6_7
};
/**
* Version number for preferences. Must be incremented every time a migration is necessary.
*/
- private static final int VERSION = 6;
+ private static final int VERSION = 7;
public static void runMigrationsIfNeeded(@NonNull final Context context) {
@@ -208,6 +249,21 @@ public final class SettingMigrations {
sp.edit().putInt(lastPrefVersionKey, currentVersion).apply();
}
+ /**
+ * Perform UI actions informing about migrations that took place if they are present.
+ * @param context Context that can be used to show dialogs/snackbars/toasts
+ */
+ public static void showUserInfoIfPresent(@NonNull final Context context) {
+ for (final Consumer consumer : MIGRATION_INFO) {
+ try {
+ consumer.accept(context);
+ } catch (final Exception e) {
+ ErrorUtil.showUiErrorSnackbar(context, "Showing migration info to the user", e);
+ }
+ }
+ MIGRATION_INFO.clear();
+ }
+
private SettingMigrations() { }
abstract static class Migration {
diff --git a/app/src/main/res/layout/fragment_blank.xml b/app/src/main/res/layout/fragment_blank.xml
index 6c2978e95..4d874ebdb 100644
--- a/app/src/main/res/layout/fragment_blank.xml
+++ b/app/src/main/res/layout/fragment_blank.xml
@@ -4,7 +4,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
-
+
Show more
Show less
The settings in the export being imported use a vulnerable format that was deprecated since NewPipe 0.27.0. Make sure the export being imported is from a trusted source, and prefer using only exports obtained from NewPipe 0.27.0 or newer in the future. Support for importing settings in this vulnerable format will soon be removed completely, and then old versions of NewPipe will not be able to import settings of exports from new versions anymore.
+ SoundCloud Top 50 page removed
+ SoundCloud has discontinued the original Top 50 charts. The corresponding tab has been removed from your main page.