Fix cached album not shown when offline

This commit is contained in:
Ming Ming 2021-09-09 02:05:00 +08:00
parent 42b931fa62
commit 6545e78bb6

View file

@ -251,12 +251,16 @@ class ListAlbumBloc extends Bloc<ListAlbumBlocEvent, ListAlbumBlocState> {
try {
shares = await shareRepo.listDir(ev.account,
File(path: remote_storage_util.getRemoteAlbumsDir(ev.account)));
} on ApiException catch(e) {
} on ApiException catch (e, stackTrace) {
if (e.response.statusCode == 404) {
// Normal when album dir is not created yet
} else {
rethrow;
_log.shout("[_queryWithAlbumDataSource] Failed while listDir", e,
stackTrace);
}
} catch (e, stackTrace) {
_log.shout(
"[_queryWithAlbumDataSource] Failed while listDir", e, stackTrace);
}
final items = albums.map((e) {
final isSharedByMe = shares.any((element) =>