Compare commits

...

3 Commits

Author SHA1 Message Date
Gustavo Moreno
903b6a2fba
Merge 3ff0f6dd27 into d9057dae57 2025-03-16 12:06:02 +05:30
Kingkor Roy Tirtho
d9057dae57 fix: invalid access token exception #2525 2025-03-16 10:32:41 +06:00
Gustavo Moreno
3ff0f6dd27 bug #2354: Fix icon overflow in Local Folder Cache page
- Wrapped  inside  to prevent layout breaking

Fixes #2354
2025-02-27 13:31:44 +01:00
2 changed files with 29 additions and 8 deletions

View File

@ -138,8 +138,10 @@ class LocalLibraryPage extends HookConsumerWidget {
icon: Column( icon: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Icon(SpotubeIcons.delete), const Expanded(child: Icon(SpotubeIcons.delete)),
Text(context.l10n.clear_cache) Text(
context.l10n.clear_cache,
)
], ],
).xSmall().iconSmall(), ).xSmall().iconSmall(),
onPressed: () async { onPressed: () async {
@ -180,7 +182,7 @@ class LocalLibraryPage extends HookConsumerWidget {
icon: Column( icon: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Icon(SpotubeIcons.export), const Expanded(child: Icon(SpotubeIcons.export)),
Text( Text(
context.l10n.export, context.l10n.export,
) )

View File

@ -30,12 +30,31 @@ class FeaturedPlaylistsNotifier
@override @override
fetch(int offset, int limit) async { fetch(int offset, int limit) async {
final playlists = await spotify.playlists.featured.getPage( try {
limit, final playlists = await spotify.playlists.featured.getPage(
offset, limit,
); offset,
);
return playlists.items?.toList() ?? []; return playlists.items?.toList() ?? [];
} catch (e) {
/// This check only needs to be done once. Since this is one of the very first
/// request
///
/// If the token is invalid, we refresh it and retry the request.
/// Same goes for expired tokens
if ((e is AuthorizationException && e.error == 'invalid_token') ||
e is ExpirationException) {
await ref.read(authenticationProvider.notifier).refreshCredentials();
final playlists = await spotify.playlists.featured.getPage(
limit,
offset,
);
return playlists.items?.toList() ?? [];
}
rethrow;
}
} }
@override @override