import 'package:aves/model/filters/filters.dart';
import 'package:aves/model/entry/entry.dart';

class FolderAlbumFilter extends CollectionFilter {
  final String path;
  final String displayName;
  final bool isRemote;

  FolderAlbumFilter({
    required this.path,
    required this.displayName,
    required this.isRemote,
  }) : super(reversed: false);

  @override
  String get key => 'folder:$path';

  @override
  String get category => 'album';

  @override
  bool get exclusiveProp => true;

  @override
  EntryPredicate get positiveTest => (AvesEntry entry) => entry.directory == path;

  @override
  Map<String, dynamic> toMap() => {
        'type': 'folder',
        'path': path,
        'displayName': displayName,
        'isRemote': isRemote,
        'reversed': reversed,
      };

  @override
  String get universalLabel => displayName;

  @override
  List<Object?> get props => [path, displayName, isRemote, reversed];

  String get label => displayName;
}
