mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-11-06 03:03:59 +00:00
Merge 9949a8b008 into 69a310c78f
This commit is contained in:
commit
56b0963fe1
@ -1,5 +1,7 @@
|
|||||||
import 'package:auto_route/auto_route.dart';
|
import 'package:auto_route/auto_route.dart';
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:spotube/collections/routes.gr.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:shadcn_flutter/shadcn_flutter.dart';
|
import 'package:shadcn_flutter/shadcn_flutter.dart';
|
||||||
import 'package:shadcn_flutter/shadcn_flutter_extension.dart';
|
import 'package:shadcn_flutter/shadcn_flutter_extension.dart';
|
||||||
@ -121,7 +123,15 @@ class ErrorBox extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
child: Text(context.l10n.view_logs),
|
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(
|
Button.text(
|
||||||
leading: const Icon(SpotubeIcons.refresh),
|
leading: const Icon(SpotubeIcons.refresh),
|
||||||
onPressed: onRetry,
|
onPressed: onRetry,
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class MetadataInstalledPluginItem extends HookConsumerWidget {
|
|||||||
final repoOwner = repoUrl?.pathSegments.firstOrNull;
|
final repoOwner = repoUrl?.pathSegments.firstOrNull;
|
||||||
|
|
||||||
final isOfficial =
|
final isOfficial =
|
||||||
repoUrl?.host == "github.com" && repoOwner == "KRTirtho";
|
repoUrl?.host == "github.com" && ["KRTirtho", "spotube"].contains(repoOwner);
|
||||||
|
|
||||||
return Basic(
|
return Basic(
|
||||||
leading: snapshot.hasData
|
leading: snapshot.hasData
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class MetadataPluginRepositoryItem extends HookConsumerWidget {
|
|||||||
.downloadAndCachePlugin(pluginRepo.repoUrl);
|
.downloadAndCachePlugin(pluginRepo.repoUrl);
|
||||||
|
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
final isOfficialPlugin = pluginRepo.owner == "KRTirtho";
|
final isOfficialPlugin = ["KRTirtho", "spotube"].contains(pluginRepo.owner);
|
||||||
|
|
||||||
final isAllowed = isOfficialPlugin
|
final isAllowed = isOfficialPlugin
|
||||||
? true
|
? true
|
||||||
@ -157,7 +157,7 @@ class MetadataPluginRepositoryItem extends HookConsumerWidget {
|
|||||||
child: Text(context.l10n.install),
|
child: Text(context.l10n.install),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (pluginRepo.owner != "KRTirtho")
|
if (!["KRTirtho", "spotube"].contains(pluginRepo.owner))
|
||||||
Text.rich(
|
Text.rich(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
children: [
|
children: [
|
||||||
@ -181,7 +181,7 @@ class MetadataPluginRepositoryItem extends HookConsumerWidget {
|
|||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 8,
|
runSpacing: 8,
|
||||||
children: [
|
children: [
|
||||||
if (pluginRepo.owner == "KRTirtho")
|
if (["KRTirtho", "spotube"].contains(pluginRepo.owner))
|
||||||
PrimaryBadge(
|
PrimaryBadge(
|
||||||
leading: const Icon(SpotubeIcons.done),
|
leading: const Icon(SpotubeIcons.done),
|
||||||
child: Text(context.l10n.official),
|
child: Text(context.l10n.official),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user