Skip to content

Commit

Permalink
fix user profile constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
javoeria committed Jan 6, 2024
1 parent 2c6c6a6 commit 101b148
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 56 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.2.1

* Fix user profile constructor.

## 2.2.0

* Requires Dart 3.0 or later.
Expand Down
6 changes: 0 additions & 6 deletions lib/src/model/user/entry_update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ abstract class EntryUpdate implements Built<EntryUpdate, EntryUpdateBuilder> {
@BuiltValueField(wireName: 'episodes_total')
int? get episodesTotal;

@BuiltValueField(wireName: 'volumes_read')
int? get volumesRead;

@BuiltValueField(wireName: 'volumes_total')
int? get volumesTotal;

@BuiltValueField(wireName: 'chapters_read')
int? get chaptersRead;

Expand Down
44 changes: 0 additions & 44 deletions lib/src/model/user/entry_update.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions lib/src/model/user/user_profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,14 @@ abstract class UserProfile implements Built<UserProfile, UserProfileBuilder> {
for (var person in jsonMap['favorites']['people']) {
person['image_url'] = person['images']['jpg']['image_url'];
}
jsonMap['anime_updates'] = jsonMap['updates']['anime'];
jsonMap['manga_updates'] = jsonMap['updates']['manga'];
for (var update in (jsonMap['anime_updates'] + jsonMap['manga_updates'])) {
update['entry']['image_url'] =
update['entry']['images']['jpg']['large_image_url'];
if (jsonMap['updates'] != null) {
jsonMap['anime_updates'] = jsonMap['updates']['anime'];
jsonMap['manga_updates'] = jsonMap['updates']['manga'];
for (var update
in (jsonMap['anime_updates'] + jsonMap['manga_updates'])) {
update['entry']['image_url'] =
update['entry']['images']['jpg']['large_image_url'];
}
}
return serializers.deserializeWith(UserProfile.serializer, jsonMap)!;
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: jikan_api
description: Dart wrapper for the Jikan API, an unofficial MyAnimeList API.
version: 2.2.0
version: 2.2.1
homepage: https://github.com/javoeria/jikan-dart

environment:
Expand Down

0 comments on commit 101b148

Please sign in to comment.