mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +01:00
Refactoring
This commit is contained in:
parent
7d078b5a8d
commit
c29b1106b5
2 changed files with 3 additions and 4 deletions
|
@ -159,7 +159,7 @@ class ListAlbumBloc extends Bloc<ListAlbumBlocEvent, ListAlbumBlocState> {
|
|||
// no data in this bloc, ignore
|
||||
return;
|
||||
}
|
||||
if (isAlbumFile(ev.file)) {
|
||||
if (isAlbumFile(ev.account, ev.file)) {
|
||||
add(_ListAlbumBlocExternalEvent());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,12 +21,11 @@ import 'package:nc_photos/remote_storage_util.dart' as remote_storage_util;
|
|||
import 'package:nc_photos/use_case/get_file_binary.dart';
|
||||
import 'package:nc_photos/use_case/ls.dart';
|
||||
import 'package:nc_photos/use_case/put_file_binary.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:quiver/iterables.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
bool isAlbumFile(File file) =>
|
||||
path.dirname(file.path).endsWith(".com.nkming.nc_photos/albums");
|
||||
bool isAlbumFile(Account account, File file) =>
|
||||
file.path.startsWith(remote_storage_util.getRemoteAlbumsDir(account));
|
||||
|
||||
/// Immutable object that represents an album
|
||||
class Album with EquatableMixin {
|
||||
|
|
Loading…
Reference in a new issue