mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-14 09:46:01 -07: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 = {
|
const _$SortingOptionsEnumMap = {
|
||||||
SortingOptions.name: 'name',
|
SortingOptions.sortName: 'sortName',
|
||||||
SortingOptions.communityRating: 'communityRating',
|
SortingOptions.communityRating: 'communityRating',
|
||||||
SortingOptions.parentalRating: 'parentalRating',
|
SortingOptions.parentalRating: 'parentalRating',
|
||||||
SortingOptions.dateAdded: 'dateAdded',
|
SortingOptions.dateAdded: 'dateAdded',
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ class LibrarySearchModel with LibrarySearchModelMappable {
|
||||||
FladderItemType.video: true,
|
FladderItemType.video: true,
|
||||||
},
|
},
|
||||||
this.favourites = false,
|
this.favourites = false,
|
||||||
this.sortingOption = SortingOptions.name,
|
this.sortingOption = SortingOptions.sortName,
|
||||||
this.sortOrder = SortingOrder.ascending,
|
this.sortOrder = SortingOrder.ascending,
|
||||||
this.hideEmptyShows = true,
|
this.hideEmptyShows = true,
|
||||||
this.recursive = false,
|
this.recursive = false,
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ class LibrarySearchModelMapper extends ClassMapperBase<LibrarySearchModel> {
|
||||||
v.sortingOption;
|
v.sortingOption;
|
||||||
static const Field<LibrarySearchModel, SortingOptions> _f$sortingOption =
|
static const Field<LibrarySearchModel, SortingOptions> _f$sortingOption =
|
||||||
Field('sortingOption', _$sortingOption,
|
Field('sortingOption', _$sortingOption,
|
||||||
opt: true, def: SortingOptions.name);
|
opt: true, def: SortingOptions.sortName);
|
||||||
static SortingOrder _$sortOrder(LibrarySearchModel v) => v.sortOrder;
|
static SortingOrder _$sortOrder(LibrarySearchModel v) => v.sortOrder;
|
||||||
static const Field<LibrarySearchModel, SortingOrder> _f$sortOrder =
|
static const Field<LibrarySearchModel, SortingOrder> _f$sortOrder =
|
||||||
Field('sortOrder', _$sortOrder, opt: true, def: SortingOrder.ascending);
|
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';
|
import 'package:fladder/util/localization_helper.dart';
|
||||||
|
|
||||||
enum SortingOptions {
|
enum SortingOptions {
|
||||||
name([ItemSortBy.name]),
|
sortName([ItemSortBy.sortname]),
|
||||||
communityRating([ItemSortBy.communityrating]),
|
communityRating([ItemSortBy.communityrating]),
|
||||||
// criticsRating([ItemSortBy.criticrating]),
|
|
||||||
parentalRating([ItemSortBy.officialrating]),
|
parentalRating([ItemSortBy.officialrating]),
|
||||||
dateAdded([ItemSortBy.datecreated]),
|
dateAdded([ItemSortBy.datecreated]),
|
||||||
dateLastContentAdded([ItemSortBy.datelastcontentadded]),
|
dateLastContentAdded([ItemSortBy.datelastcontentadded]),
|
||||||
|
|
@ -23,10 +22,10 @@ enum SortingOptions {
|
||||||
const SortingOptions(this.value);
|
const SortingOptions(this.value);
|
||||||
final List<ItemSortBy> 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) {
|
String label(BuildContext context) => switch (this) {
|
||||||
name => context.localized.name,
|
sortName => context.localized.name,
|
||||||
communityRating => context.localized.communityRating,
|
communityRating => context.localized.communityRating,
|
||||||
parentalRating => context.localized.parentalRating,
|
parentalRating => context.localized.parentalRating,
|
||||||
dateAdded => context.localized.dateAdded,
|
dateAdded => context.localized.dateAdded,
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ class BookDetailsProviderNotifier extends StateNotifier<BookProviderModel> {
|
||||||
siblingsResponse = await api.itemsGet(
|
siblingsResponse = await api.itemsGet(
|
||||||
parentId: parentModel.id,
|
parentId: parentModel.id,
|
||||||
recursive: true,
|
recursive: true,
|
||||||
sortBy: SortingOptions.name.toSortBy,
|
sortBy: SortingOptions.sortName.toSortBy,
|
||||||
fields: [
|
fields: [
|
||||||
ItemFields.genres,
|
ItemFields.genres,
|
||||||
ItemFields.parentid,
|
ItemFields.parentid,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue