mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: Use sortName instead of name for searches/library views (#359)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
c589b9e8fc
commit
a8795cf0c9
5 changed files with 7 additions and 8 deletions
|
|
@ -93,7 +93,7 @@ const _$FladderItemTypeEnumMap = {
|
|||
};
|
||||
|
||||
const _$SortingOptionsEnumMap = {
|
||||
SortingOptions.name: 'name',
|
||||
SortingOptions.sortName: 'sortName',
|
||||
SortingOptions.communityRating: 'communityRating',
|
||||
SortingOptions.parentalRating: 'parentalRating',
|
||||
SortingOptions.dateAdded: 'dateAdded',
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class LibrarySearchModel with LibrarySearchModelMappable {
|
|||
FladderItemType.video: true,
|
||||
},
|
||||
this.favourites = false,
|
||||
this.sortingOption = SortingOptions.name,
|
||||
this.sortingOption = SortingOptions.sortName,
|
||||
this.sortOrder = SortingOrder.ascending,
|
||||
this.hideEmptyShows = true,
|
||||
this.recursive = false,
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class LibrarySearchModelMapper extends ClassMapperBase<LibrarySearchModel> {
|
|||
v.sortingOption;
|
||||
static const Field<LibrarySearchModel, SortingOptions> _f$sortingOption =
|
||||
Field('sortingOption', _$sortingOption,
|
||||
opt: true, def: SortingOptions.name);
|
||||
opt: true, def: SortingOptions.sortName);
|
||||
static SortingOrder _$sortOrder(LibrarySearchModel v) => v.sortOrder;
|
||||
static const Field<LibrarySearchModel, SortingOrder> _f$sortOrder =
|
||||
Field('sortOrder', _$sortOrder, opt: true, def: SortingOrder.ascending);
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ import 'package:fladder/models/item_base_model.dart';
|
|||
import 'package:fladder/util/localization_helper.dart';
|
||||
|
||||
enum SortingOptions {
|
||||
name([ItemSortBy.name]),
|
||||
sortName([ItemSortBy.sortname]),
|
||||
communityRating([ItemSortBy.communityrating]),
|
||||
// criticsRating([ItemSortBy.criticrating]),
|
||||
parentalRating([ItemSortBy.officialrating]),
|
||||
dateAdded([ItemSortBy.datecreated]),
|
||||
dateLastContentAdded([ItemSortBy.datelastcontentadded]),
|
||||
|
|
@ -23,10 +22,10 @@ enum SortingOptions {
|
|||
const SortingOptions(this.value);
|
||||
final List<ItemSortBy> value;
|
||||
|
||||
List<ItemSortBy> get toSortBy => [...value, ItemSortBy.name];
|
||||
List<ItemSortBy> get toSortBy => [...value, ItemSortBy.sortname];
|
||||
|
||||
String label(BuildContext context) => switch (this) {
|
||||
name => context.localized.name,
|
||||
sortName => context.localized.name,
|
||||
communityRating => context.localized.communityRating,
|
||||
parentalRating => context.localized.parentalRating,
|
||||
dateAdded => context.localized.dateAdded,
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class BookDetailsProviderNotifier extends StateNotifier<BookProviderModel> {
|
|||
siblingsResponse = await api.itemsGet(
|
||||
parentId: parentModel.id,
|
||||
recursive: true,
|
||||
sortBy: SortingOptions.name.toSortBy,
|
||||
sortBy: SortingOptions.sortName.toSortBy,
|
||||
fields: [
|
||||
ItemFields.genres,
|
||||
ItemFields.parentid,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue