From a23497867adedb8875b45de1554d912095692790 Mon Sep 17 00:00:00 2001 From: shantanu sharma Date: Sun, 11 Oct 2026 00:36:01 +0530 Subject: [PATCH 1/2] fix: mark spotube org as official for plugins --- lib/modules/metadata_plugins/installed_plugin.dart | 2 +- lib/modules/metadata_plugins/plugin_repository.dart | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/modules/metadata_plugins/installed_plugin.dart b/lib/modules/metadata_plugins/installed_plugin.dart index 7abda5ec..6d4a737c 100644 --- a/lib/modules/metadata_plugins/installed_plugin.dart +++ b/lib/modules/metadata_plugins/installed_plugin.dart @@ -83,7 +83,7 @@ class MetadataInstalledPluginItem extends HookConsumerWidget { final repoOwner = repoUrl?.pathSegments.firstOrNull; final isOfficial = - repoUrl?.host == "github.com" && repoOwner == "KRTirtho"; + repoUrl?.host == "github.com" && ["KRTirtho", "spotube"].contains(repoOwner); return Basic( leading: snapshot.hasData diff --git a/lib/modules/metadata_plugins/plugin_repository.dart b/lib/modules/metadata_plugins/plugin_repository.dart index 9bd71f0a..6ff3519f 100644 --- a/lib/modules/metadata_plugins/plugin_repository.dart +++ b/lib/modules/metadata_plugins/plugin_repository.dart @@ -57,7 +57,7 @@ class MetadataPluginRepositoryItem extends HookConsumerWidget { .downloadAndCachePlugin(pluginRepo.repoUrl); if (!context.mounted) return; - final isOfficialPlugin = pluginRepo.owner == "KRTirtho"; + final isOfficialPlugin = ["KRTirtho", "spotube"].contains(pluginRepo.owner); final isAllowed = isOfficialPlugin ? true @@ -157,7 +157,7 @@ class MetadataPluginRepositoryItem extends HookConsumerWidget { child: Text(context.l10n.install), ), ), - if (pluginRepo.owner != "KRTirtho") + if (!["KRTirtho", "spotube"].contains(pluginRepo.owner)) Text.rich( TextSpan( children: [ @@ -181,7 +181,7 @@ class MetadataPluginRepositoryItem extends HookConsumerWidget { spacing: 8, runSpacing: 8, children: [ - if (pluginRepo.owner == "KRTirtho") + if (["KRTirtho", "spotube"].contains(pluginRepo.owner)) PrimaryBadge( leading: const Icon(SpotubeIcons.done), child: Text(context.l10n.official), From 9949a8b008511bb60f037887d8e100de2a7fec79 Mon Sep 17 00:00:00 2001 From: shantanu sharma Date: Sun, 11 Oct 2026 00:38:10 +0530 Subject: [PATCH 2/2] feat: handle 401 DioException and redirect to metadata provider settings --- lib/components/fallbacks/error_box.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/components/fallbacks/error_box.dart b/lib/components/fallbacks/error_box.dart index fd56cb58..0724158f 100644 --- a/lib/components/fallbacks/error_box.dart +++ b/lib/components/fallbacks/error_box.dart @@ -1,5 +1,7 @@ import 'package:auto_route/auto_route.dart'; +import 'package:dio/dio.dart'; import 'package:flutter/services.dart'; +import 'package:spotube/collections/routes.gr.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; import 'package:shadcn_flutter/shadcn_flutter_extension.dart'; @@ -121,7 +123,15 @@ class ErrorBox extends StatelessWidget { }, child: Text(context.l10n.view_logs), ), - if (onRetry != null) + if (error is DioException && error.response?.statusCode == 401) + Button.text( + leading: const Icon(SpotubeIcons.settings), + onPressed: () { + context.navigateTo(const SettingsMetadataProviderRoute()); + }, + child: Text(context.l10n.install_a_metadata_provider), + ) + else if (onRetry != null) Button.text( leading: const Icon(SpotubeIcons.refresh), onPressed: onRetry,