Skip to content

Commit

Permalink
Users: add limits to settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
UweTrottmann committed Jan 25, 2024
1 parent 93ef1f0 commit 2eb90a0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Change Log
## In development

* Add method to reorder lists. Thanks @ZelKami! #131
* Add limits to user settings.

## 6.11.2
_2022-09-01_
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/com/uwetrottmann/trakt5/entities/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,22 @@ public class Settings {
public Account account;
public Connections connections;
public SharingText sharing_text;
public Limits limits;

public static class Limits {

public CountAndItemCount list;
public ItemCount watchlist;
public ItemCount favorites;
public ItemCount recommendations;

public static class ItemCount {
public Integer item_count;
}

public static class CountAndItemCount extends ItemCount {
public Integer count;
}

}
}
5 changes: 5 additions & 0 deletions src/test/java/com/uwetrottmann/trakt5/services/UsersTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public void test_getSettings() throws IOException {
assertThat(settings.account).isNotNull();
assertThat(settings.connections).isNotNull();
assertThat(settings.sharing_text).isNotNull();
assertThat(settings.limits.list.count).isPositive();
assertThat(settings.limits.list.item_count).isPositive();
assertThat(settings.limits.watchlist.item_count).isPositive();
assertThat(settings.limits.favorites.item_count).isPositive();
assertThat(settings.limits.recommendations.item_count).isPositive();
}

@Test
Expand Down

0 comments on commit 2eb90a0

Please sign in to comment.