small fix

This commit is contained in:
Schnitzel5 2024-12-22 20:47:11 +01:00
parent 478c0ba45c
commit 80a8feee33
4 changed files with 6 additions and 6 deletions

View file

@ -19,7 +19,7 @@ class Category {
Category.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
forItemType = json['forItemType'];
forItemType = ItemType.values[json['forItemType'] ?? 0];
}
Category.fromJsonV1(Map<String, dynamic> json) {
@ -33,5 +33,5 @@ class Category {
}
Map<String, dynamic> toJson() =>
{'id': id, 'name': name, 'forItemType': forItemType};
{'id': id, 'name': name, 'forItemType': forItemType.index};
}

View file

@ -34,7 +34,7 @@ class History {
chapterId = json['chapterId'];
date = json['date'];
id = json['id'];
itemType = json['itemType'];
itemType = ItemType.values[json['itemType'] ?? 0];
mangaId = json['mangaId'];
}
@ -54,7 +54,7 @@ class History {
'chapterId': chapterId,
'date': date,
'id': id,
'itemType': itemType,
'itemType': itemType.index,
'mangaId': mangaId
};
}

View file

@ -87,7 +87,7 @@ class Manga {
id = json['id'];
imageUrl = json['imageUrl'];
isLocalArchive = json['isLocalArchive'];
itemType = ItemType.values[json['itemType']];
itemType = ItemType.values[json['itemType'] ?? 0];
lang = json['lang'];
lastRead = json['lastRead'];
lastUpdate = json['lastUpdate'];

View file

@ -171,7 +171,7 @@ class Source {
'isAdded': isAdded,
'isFullData': isFullData,
'isManga': isManga,
'itemType': itemType,
'itemType': itemType.index,
'isNsfw': isNsfw,
'isPinned': isPinned,
'lang': lang,