Compare commits

..

1 Commits

Author SHA1 Message Date
Gustavo Moreno
08d41e3b66
Merge 3ff0f6dd27 into e61b79585e 2025-03-16 01:23:26 +00:00

View File

@ -30,31 +30,12 @@ class FeaturedPlaylistsNotifier
@override
fetch(int offset, int limit) async {
try {
final playlists = await spotify.playlists.featured.getPage(
limit,
offset,
);
final playlists = await spotify.playlists.featured.getPage(
limit,
offset,
);
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;
}
return playlists.items?.toList() ?? [];
}
@override