[Bugfix] Sync items not sorted by sortName (#13)

Now sort the items by sortName

---------

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2024-10-13 19:53:45 +02:00 committed by GitHub
parent c53b9b2281
commit a932fa71ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 244 additions and 230 deletions

View file

@ -1,8 +1,9 @@
import 'dart:convert';
import 'package:fladder/models/syncing/sync_item.dart';
import 'package:isar/isar.dart';
import 'package:fladder/models/syncing/sync_item.dart';
part 'i_synced_item.g.dart';
// extension IsarExtensions on String? {
@ -27,7 +28,7 @@ part 'i_synced_item.g.dart';
class ISyncedItem {
String? userId;
String id;
int? sortKey;
String? sortName;
String? parentId;
String? path;
int? fileSize;
@ -41,7 +42,7 @@ class ISyncedItem {
ISyncedItem({
this.userId,
required this.id,
this.sortKey,
this.sortName,
this.parentId,
this.path,
this.fileSize,
@ -61,7 +62,7 @@ class ISyncedItem {
userId: syncedItem.userId,
path: syncedItem.path?.replaceAll(path ?? "", '').substring(1),
fileSize: syncedItem.fileSize,
sortKey: syncedItem.sortKey,
sortName: syncedItem.sortName,
videoFileName: syncedItem.videoFileName,
trickPlayModel: syncedItem.fTrickPlayModel != null ? jsonEncode(syncedItem.fTrickPlayModel?.toJson()) : null,
introOutroSkipModel: