* Check into an episode. This should be tied to a user action to manually indicate they are watching something. The
* item will display as watching on the site, then automatically switch to watched status once the duration has
@@ -40,7 +41,7 @@ Call
* Check into a movie. This should be tied to a user action to manually indicate they are watching something. The
* item will display as watching on the site, then automatically switch to watched status once the duration has
@@ -52,7 +53,7 @@ Call
* Removes any active checkins, no need to provide a specific item.
*/
diff --git a/src/main/java/com/uwetrottmann/trakt5/services/Comments.java b/src/main/java/com/uwetrottmann/trakt5/services/Comments.java
index 2d7681f0..e7d43090 100644
--- a/src/main/java/com/uwetrottmann/trakt5/services/Comments.java
+++ b/src/main/java/com/uwetrottmann/trakt5/services/Comments.java
@@ -16,6 +16,7 @@
package com.uwetrottmann.trakt5.services;
+import com.uwetrottmann.trakt5.TraktV2;
import com.uwetrottmann.trakt5.entities.Comment;
import retrofit2.Call;
import retrofit2.http.Body;
@@ -30,7 +31,7 @@
public interface Comments {
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
* Add a new comment to a movie, show, episode, or list. If you add a review, it needs to be at least 200 words.
* Also make sure to allow and encourage spoilers to be indicated in your app.
@@ -44,7 +45,7 @@ Call
* Returns a single comment and indicates how many replies it has. Use GET /comments/:id/replies to get the actual
* replies.
@@ -57,7 +58,7 @@ Call
* Update a single comment created within the last hour. The OAuth user must match the author of the comment in
* order to update it.
@@ -72,7 +73,7 @@ Call
* Delete a single comment created within the last hour. This also effectively removes any replies this comment has.
* The OAuth user must match the author of the comment in order to delete it.
@@ -85,7 +86,7 @@ Call
* Returns all replies for a comment. It is possible these replies could have replies themselves, so in that case
* you would just call GET /comment/:id/replies again with the new comment_id.
@@ -98,7 +99,7 @@ Call
* Add a new reply to an existing comment. Also make sure to allow and encourage spoilers to be indicated in your
* app.
diff --git a/src/main/java/com/uwetrottmann/trakt5/services/Notes.java b/src/main/java/com/uwetrottmann/trakt5/services/Notes.java
index fc9135e9..5e544107 100644
--- a/src/main/java/com/uwetrottmann/trakt5/services/Notes.java
+++ b/src/main/java/com/uwetrottmann/trakt5/services/Notes.java
@@ -16,6 +16,7 @@
package com.uwetrottmann.trakt5.services;
+import com.uwetrottmann.trakt5.TraktV2;
import com.uwetrottmann.trakt5.entities.AddNoteRequest;
import com.uwetrottmann.trakt5.entities.Note;
import com.uwetrottmann.trakt5.entities.UpdateNoteRequest;
@@ -30,7 +31,7 @@
public interface Notes {
/**
- * VIP Only, OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
* Add a note (maximum 500 characters). Note: this also replaces an existing note.
*
@@ -42,7 +43,7 @@ Call
* Get a note.
*
@@ -54,7 +55,7 @@ Call
* Update a note (maximum 500 characters).
*
@@ -67,7 +68,7 @@ Call
* Delete a note.
*
diff --git a/src/main/java/com/uwetrottmann/trakt5/services/Recommendations.java b/src/main/java/com/uwetrottmann/trakt5/services/Recommendations.java
index d548b2e9..bdda1c41 100644
--- a/src/main/java/com/uwetrottmann/trakt5/services/Recommendations.java
+++ b/src/main/java/com/uwetrottmann/trakt5/services/Recommendations.java
@@ -16,6 +16,7 @@
package com.uwetrottmann.trakt5.services;
+import com.uwetrottmann.trakt5.TraktV2;
import com.uwetrottmann.trakt5.entities.Movie;
import com.uwetrottmann.trakt5.entities.Show;
import com.uwetrottmann.trakt5.enums.Extended;
@@ -30,7 +31,7 @@
public interface Recommendations {
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
* Personalized movie recommendations for a user. Results returned with the top recommendation first.
*
@@ -45,7 +46,7 @@ Call
* Dismiss a movie from getting recommended anymore.
*
@@ -57,7 +58,7 @@ Call
* Personalized show recommendations for a user. Results returned with the top recommendation first.
*
@@ -72,7 +73,7 @@ Call
* Dismiss a show from getting recommended anymore.
*
diff --git a/src/main/java/com/uwetrottmann/trakt5/services/Scrobble.java b/src/main/java/com/uwetrottmann/trakt5/services/Scrobble.java
index 440b09ca..e1afb0cd 100644
--- a/src/main/java/com/uwetrottmann/trakt5/services/Scrobble.java
+++ b/src/main/java/com/uwetrottmann/trakt5/services/Scrobble.java
@@ -16,6 +16,7 @@
package com.uwetrottmann.trakt5.services;
+import com.uwetrottmann.trakt5.TraktV2;
import com.uwetrottmann.trakt5.entities.PlaybackResponse;
import com.uwetrottmann.trakt5.entities.ScrobbleProgress;
import retrofit2.Call;
@@ -24,7 +25,7 @@
public interface Scrobble {
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
* User starts a video
*/
@@ -34,7 +35,7 @@ Call
* User pauses a video
*/
@@ -44,7 +45,7 @@ Call
* User stops a video
*/
diff --git a/src/main/java/com/uwetrottmann/trakt5/services/Shows.java b/src/main/java/com/uwetrottmann/trakt5/services/Shows.java
index a3eb79d6..29d1f1a9 100755
--- a/src/main/java/com/uwetrottmann/trakt5/services/Shows.java
+++ b/src/main/java/com/uwetrottmann/trakt5/services/Shows.java
@@ -16,6 +16,7 @@
package com.uwetrottmann.trakt5.services;
+import com.uwetrottmann.trakt5.TraktV2;
import com.uwetrottmann.trakt5.entities.BaseShow;
import com.uwetrottmann.trakt5.entities.Comment;
import com.uwetrottmann.trakt5.entities.Credits;
@@ -123,7 +124,7 @@ Call
* Returns collection progress for show including details on all seasons and episodes. The {@code next_episode} will
* be the next episode the user should collect, if there are no upcoming episodes it will be set to {@code null}.
@@ -162,7 +163,7 @@ Call
* Returns watched progress for show including details on all seasons and episodes. The {@code next_episode} will be
* the next episode the user should watch, if there are no upcoming episodes it will be set to {@code null}. If not
diff --git a/src/main/java/com/uwetrottmann/trakt5/services/Sync.java b/src/main/java/com/uwetrottmann/trakt5/services/Sync.java
index c4088ac3..f5c902f0 100644
--- a/src/main/java/com/uwetrottmann/trakt5/services/Sync.java
+++ b/src/main/java/com/uwetrottmann/trakt5/services/Sync.java
@@ -16,8 +16,10 @@
package com.uwetrottmann.trakt5.services;
+import com.uwetrottmann.trakt5.TraktV2;
import com.uwetrottmann.trakt5.entities.BaseMovie;
import com.uwetrottmann.trakt5.entities.BaseShow;
+import com.uwetrottmann.trakt5.entities.HistoryEntry;
import com.uwetrottmann.trakt5.entities.LastActivities;
import com.uwetrottmann.trakt5.entities.PlaybackResponse;
import com.uwetrottmann.trakt5.entities.RatedEpisode;
@@ -26,10 +28,14 @@
import com.uwetrottmann.trakt5.entities.RatedShow;
import com.uwetrottmann.trakt5.entities.SyncItems;
import com.uwetrottmann.trakt5.entities.SyncResponse;
+import com.uwetrottmann.trakt5.entities.UserSlug;
import com.uwetrottmann.trakt5.entities.WatchlistedEpisode;
import com.uwetrottmann.trakt5.entities.WatchlistedSeason;
import com.uwetrottmann.trakt5.enums.Extended;
+import com.uwetrottmann.trakt5.enums.HistoryType;
+import com.uwetrottmann.trakt5.enums.PlaybackType;
import com.uwetrottmann.trakt5.enums.RatingsFilter;
+import org.threeten.bp.OffsetDateTime;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
@@ -38,12 +44,13 @@
import retrofit2.http.Path;
import retrofit2.http.Query;
+import javax.annotation.Nonnull;
import java.util.List;
public interface Sync {
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
* This method is a useful first step in the syncing process. We recommended caching these dates locally, then you
* can compare to know exactly what data has changed recently. This can greatly optimize your syncs so you don't
@@ -53,31 +60,61 @@ public interface Sync {
Call
- * Get all collected movies in a user's collection. A collected item indicates availability to watch digitally or on
- * physical media.
+ * Get all movies in a user's library (formerly collection). A collected item indicates availability to watch
+ * digitally or on physical media.
+ *
+ * @deprecated Use {@link #collectionMovies(int, int, Extended)} instead.
+ */
+ @Deprecated
+ @GET("sync/collection/movies")
+ Call
+ * Like {@link Users#collectionMovies(UserSlug, int, int, Extended)}.
*/
@GET("sync/collection/movies")
Call
- * Get all collected shows in a user's collection. A collected item indicates availability to watch digitally or on
- * physical media.
+ * Get all shows in a user's library (formerly collection). A collected item indicates availability to watch
+ * digitally or on physical media.
+ *
+ * @deprecated Use {@link #collectionShows(int, int, Extended)} instead.
*/
+ @Deprecated
@GET("sync/collection/shows")
Call
- * Add one or more items to a user's collection including the format of the item.
+ * Like {@link Users#collectionShows(UserSlug, int, int, Extended)}.
+ */
+ @GET("sync/collection/shows")
+ Call
+ * Add one or more items to a user's library (formerly collection) including the format of the item.
*
* @param items A list of movies, shows, seasons or episodes.
*/
@@ -87,9 +124,9 @@ Call
- * Remove one or more items from a user's collection.
+ * Remove one or more items from a user's library (formerly collection).
*
* @param items A list of movies, shows, seasons or episodes.
*/
@@ -99,7 +136,7 @@ Call
* Returns all movies a user has watched.
*/
@@ -109,37 +146,88 @@ Call
+ * Whenever a scrobble is paused, the playback progress is saved. Use this progress to sync up playback across
+ * different media centers or apps. For example, you can start watching a movie in a media center, stop it, then
+ * resume on your tablet from the same spot. Each item will have the progress percentage between 0 and 100.
+ *
+ * Use {@link #playback(PlaybackType, OffsetDateTime, OffsetDateTime, Integer, Integer)} to specify a type to only
+ * get movies or episodes.
+ *
+ * By default, all results will be returned. Pagination is optional and can be used for something like an "on deck"
+ * feature, or if you only need a limited data set.
+ *
+ * Note: Trakt only saves playback progress for the last 6 months.
+ *
+ * @see #playback(PlaybackType, OffsetDateTime, OffsetDateTime, Integer, Integer)
+ */
+ @GET("sync/playback")
+ Call
+ * Like {@link #playback(OffsetDateTime, OffsetDateTime, Integer, Integer)}, but allows to specify a type to only
+ * get movies or episodes.
+ *
+ * @see #playback(OffsetDateTime, OffsetDateTime, Integer, Integer)
+ */
+ @GET("sync/playback/{type}")
+ Call
* Returns all playbacks;
+ *
+ * @deprecated Use {@link #playback(OffsetDateTime, OffsetDateTime, Integer, Integer)} instead.
*/
+ @Deprecated
@GET("sync/playback")
Call
* Returns all playbacks;
+ *
+ * @deprecated Use {@link #playback(PlaybackType, OffsetDateTime, OffsetDateTime, Integer, Integer)} instead.
*/
+ @Deprecated
@GET("sync/playback/episodes")
Call
* Returns all playbacks;
+ *
+ * @deprecated Use {@link #playback(PlaybackType, OffsetDateTime, OffsetDateTime, Integer, Integer)} instead.
*/
+ @Deprecated
@GET("sync/playback/movies")
Call
* Remove a playback item from a user's playback progress list. A 404 will be returned if the id is invalid.
*
@@ -152,7 +240,7 @@ Call
* Returns all shows a user has watched.
*/
@@ -162,7 +250,59 @@ Call
+ * Like {@link Users#history(UserSlug, Integer, Integer, Extended, OffsetDateTime, OffsetDateTime)}.
+ *
+ * @see Sync#history(HistoryType, Integer, Integer, Extended, OffsetDateTime, OffsetDateTime)
+ */
+ @GET("sync/history")
+ Call
+ * Like {@link #history(Integer, Integer, Extended, OffsetDateTime, OffsetDateTime)}, but allows to set a type to
+ * only return movies or episodes.
+ *
+ * @see Users#history(UserSlug, HistoryType, Integer, Integer, Extended, OffsetDateTime, OffsetDateTime)
+ * @see Sync#history(Integer, Integer, Extended, OffsetDateTime, OffsetDateTime)
+ */
+ @GET("sync/history/{type}")
+ Call
+ * Like
+ * {@link Users#history(UserSlug, HistoryType, int, Integer, Integer, Extended, OffsetDateTime, OffsetDateTime)}.
+ */
+ @GET("sync/history/{type}/{id}")
+ Call
* Add items to a user's watch history. Accepts shows, seasons, episodes and movies. If only a show is passed,
* assumes all seasons are to be marked watched. Same for seasons. Send a
* Remove items from a user's watch history including all watches, scrobbles, and checkins. Accepts shows, seasons,
* episodes and movies. If only a show is passed, assumes all seasons are to be removed from history. Same for
@@ -190,7 +330,7 @@ Call
* Get a user's ratings filtered by movies. You can filter for a specific rating between 1 and 10.
*
@@ -209,7 +349,7 @@ Call
* Get a user's ratings filtered by shows. You can filter for a specific rating between 1 and 10.
*
@@ -228,7 +368,7 @@ Call
* Get a user's ratings filtered by seasons. You can filter for a specific rating between 1 and 10.
*
@@ -247,7 +387,7 @@ Call
* Get a user's ratings filtered by episodes. You can filter for a specific rating between 1 and 10.
*
@@ -266,7 +406,7 @@ Call
* Rate one or more items.
*
@@ -278,7 +418,7 @@ Call
* Delete ratings for one or more items.
*
@@ -291,43 +431,105 @@ Call
- * Returns all items in a user's watchlist filtered by movies. When an item is watched, it will be automatically
- * removed from the watchlist. To track what the user is actively watching, use the progress APIs.
+ * Like {@link Users#watchlistMovies(UserSlug, Extended)}.
+ */
+ @GET("sync/watchlist/movies")
+ Call
- * Returns all items in a user's watchlist filtered by shows. When an item is watched, it will be automatically
- * removed from the watchlist. To track what the user is actively watching, use the progress APIs.
+ * Like {@link Users#watchlistShows(UserSlug, Extended)}.
+ */
+ @GET("sync/watchlist/shows")
+ Call
- * Returns all items in a user's watchlist filtered by seasons. When an item is watched, it will be automatically
- * removed from the watchlist. To track what the user is actively watching, use the progress APIs.
+ * Like {@link Users#watchlistSeasons(UserSlug, Extended)}.
+ */
+ @GET("sync/watchlist/seasons")
+ Call
- * Returns all items in a user's watchlist filtered by episodes. When an item is watched, it will be automatically
- * removed from the watchlist. To track what the user is actively watching, use the progress APIs.
+ * Like {@link Users#watchlistEpisodes(UserSlug, Extended)}.
*/
@GET("sync/watchlist/episodes")
Call
* Add one of more items to a user's watchlist.
*
@@ -347,7 +571,7 @@ Call
* Delete one or more items from a user's watchlist.
*
diff --git a/src/main/java/com/uwetrottmann/trakt5/services/Users.java b/src/main/java/com/uwetrottmann/trakt5/services/Users.java
index 93ba1153..0edb0c1f 100644
--- a/src/main/java/com/uwetrottmann/trakt5/services/Users.java
+++ b/src/main/java/com/uwetrottmann/trakt5/services/Users.java
@@ -16,6 +16,7 @@
package com.uwetrottmann.trakt5.services;
+import com.uwetrottmann.trakt5.TraktV2;
import com.uwetrottmann.trakt5.entities.BaseMovie;
import com.uwetrottmann.trakt5.entities.BaseShow;
import com.uwetrottmann.trakt5.entities.Followed;
@@ -51,12 +52,13 @@
import retrofit2.http.Path;
import retrofit2.http.Query;
+import javax.annotation.Nonnull;
import java.util.List;
public interface Users {
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
* Get the user's settings so you can align your app's experience with what they're used to on the Trakt website.
*/
@@ -64,7 +66,7 @@ public interface Users {
Call
* Get a user's profile information. If the user is private, info will only be returned if you send OAuth and are
* either that user or an approved follower.
@@ -78,13 +80,15 @@ Call
- * Get all collected movies in a user's collection. A collected item indicates availability to watch digitally or on
- * physical media.
+ * Get all movies in a user's library (formerly collection). A collected item indicates availability to watch
+ * digitally or on physical media.
*
* @param userSlug Example: "sean".
+ * @deprecated Use {@link #collectionMovies(UserSlug, int, int, Extended)} instead.
*/
+ @Deprecated
@GET("users/{username}/collection/movies")
Call
- * Get all collected shows in a user's collection. A collected item indicates availability to watch digitally or on
- * physical media.
+ * Get all movies in a user's library (formerly collection).
*
* @param userSlug Example: "sean".
+ * @param page Number of page of results to be returned.
+ * @param limit Number of results to return per page.
+ * @see Sync#collectionMovies(int, int, Extended)
+ */
+ @GET("users/{username}/collection/movies")
+ Call
+ * Get all shows in a user's library (formerly collection). A collected item indicates availability to watch
+ * digitally or on physical media.
+ *
+ * @param userSlug Example: "sean".
+ * @deprecated Use {@link #collectionShows(UserSlug, int, int, Extended)} instead.
+ */
+ @Deprecated
+ @GET("users/{username}/collection/shows")
+ Call
+ * Get all shows in a user's library (formerly collection).
+ *
+ * @param userSlug Example: "sean".
+ * @param page Number of page of results to be returned.
+ * @param limit Number of results to return per page.
+ * @see Sync#collectionShows(int, int, Extended)
*/
@GET("users/{username}/collection/shows")
Call
* Returns the most recently added notes for the user.
*
@@ -122,7 +164,7 @@ Call
* Returns all custom lists for a user.
*/
@@ -132,7 +174,7 @@ Call
* Create a new custom list. The name is the only required field, but the other info is recommended to ask for.
*/
@@ -143,7 +185,7 @@ Call
* Update a custom list by sending 1 or more parameters. If you update the list name, the original slug will still
* be retained so existing references to this list won't break.
@@ -156,7 +198,7 @@ Call
* Remove a custom list and all items it contains.
*/
@@ -167,7 +209,7 @@ Call
* Reorder all custom lists by sending the updated rank of list ids.
*/
@@ -178,10 +220,13 @@ Call
* Get all items on a custom list. Items can be movies, shows, seasons, episodes, or people.
+ *
+ * @deprecated Use {@link #listItems(UserSlug, String, int, int, Extended)} instead.
*/
+ @Deprecated
@GET("users/{username}/lists/{id}/items")
Call
+ * Get all items on a personal list. Items can be a movie, show, season, episode, or person. Use
+ * {@link #listItems(UserSlug, String, String, int, int, Extended)} to specify the type parameter with a single
+ * value or comma-delimited string for multiple item types.
+ *
+ * Notes: Each list item contains a notes field with text entered by the user.
+ *
+ * Sorting: Default sorting is based on the list defaults and sent in the X-Sort-By and X-Sort-How headers. Use
+ * {@link #listItems(UserSlug, String, String, String, String, int, int, Extended)} to specify a custom sort order.
+ */
+ @GET("users/{username}/lists/{id}/items")
+ Call
+ * The specified order will be sent in the X-Applied-Sort-By and X-Applied-Sort-How headers.
+ *
+ * Some sort_by options are VIP Only including imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore,
+ * votes, imdb_votes, and tmdb_votes. If sent for a non VIP, the items will fall back to rank.
+ *
+ * @param sortBy Sort by a specific property. Possible values: rank, added, title, released , runtime, popularity,
+ * random, percentage, imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore, votes,
+ * imdb_votes, tmdb_votes, my_rating, watched, collected.
+ * @param sortHow Sort direction. Possible values: asc, desc.
+ */
+ @GET("users/{username}/lists/{id}/items/{sort_by}/{sort_how}")
+ Call
+ * The specified order will be sent in the X-Applied-Sort-By and X-Applied-Sort-How headers.
+ *
+ * Some sort_by options are VIP Only including imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore,
+ * votes, imdb_votes, and tmdb_votes. If sent for a non VIP, the items will fall back to rank.
+ *
+ * @param type Filter for a specific item type. Example: {@code movie,show}. Possible values: movie, show,
+ * season, episode, person.
+ * @param sortBy Sort by a specific property. Possible values: rank, added, title, released, runtime, popularity,
+ * random, percentage, imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore, votes,
+ * imdb_votes, tmdb_votes, my_rating, watched, collected.
+ * @param sortHow Sort direction. Possible values: asc, desc.
+ */
+ @GET("users/{username}/lists/{id}/items/{type}/{sort_by}/{sort_how}")
+ Call
* Add one or more items to a custom list. Items can be movies, shows, seasons, episodes, or people.
*/
@@ -202,7 +336,7 @@ Call
* Remove one or more items from a custom list.
*/
@@ -214,7 +348,7 @@ Call
* Reorder all items on a list by sending the updated rank of list item ids.
*/
@@ -226,7 +360,7 @@ Call
* If the user has a private profile, the follow request will require approval (approved_at will be null). If a user
* is public, they will be followed immediately (approved_at will have a date).
@@ -239,7 +373,7 @@ Call
* Unfollow someone you already follow.
*/
@@ -249,7 +383,7 @@ Call
* Returns all followers including when the relationship began.
*/
@@ -260,7 +394,7 @@ Call
* Returns all user's they follow including when the relationship began.
*/
@@ -271,7 +405,7 @@ Call
* Returns all friends for a user including when the relationship began. Friendship is a 2 way relationship where
* each user follows the other.
@@ -283,7 +417,7 @@ Call
* Returns movies and episodes that a user has watched, sorted by most recent.
*
@@ -292,6 +426,7 @@ Call
- * Returns movies or episodes that a user has watched, sorted by most recent.
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
- * The {@code id} uniquely identifies each history event and can be used to remove events individually using the
- * {@code POST /sync/history/remove method}. The action will be set to {@code scrobble}, {@code checkin}, or
- * {@code watch}.
+ * Like {@link #history(UserSlug, Integer, Integer, Extended, OffsetDateTime, OffsetDateTime)}, but allows to set a
+ * type to only return movies or episodes.
*
* @param userSlug Example: "sean".
+ * @see Sync#history(HistoryType, Integer, Integer, Extended, OffsetDateTime, OffsetDateTime)
*/
@GET("users/{username}/history/{type}")
Call
* Returns the history for just the specified item. For example, {@code /history/movies/12601} would return all
* watches for TRON: Legacy and {@code /history/shows/1388} would return all watched episodes for Breaking Bad. If
@@ -338,6 +471,7 @@ Call
* Get a user's ratings filtered by movies. You can filter for a specific rating between 1 and 10.
*
@@ -367,7 +501,7 @@ Call
* Get a user's ratings filtered by shows. You can filter for a specific rating between 1 and 10.
*
@@ -382,7 +516,7 @@ Call
* Get a user's ratings filtered by seasons. You can filter for a specific rating between 1 and 10.
*
@@ -397,7 +531,7 @@ Call
* Get a user's ratings filtered by episodes. You can filter for a specific rating between 1 and 10.
*
@@ -412,55 +546,227 @@ Call
- * Returns all items in a user's watchlist filtered by movies. When an item is watched, it will be automatically
- * removed from the watchlist. To track what the user is actively watching, use the progress APIs.
+ * Returns all items in a user's watchlist filtered by movies.
+ *
+ * The watchlist should not be used as a list of what the user is actively watching. Use a combination of the
+ * /sync/watched and /shows/:id/progress methods to get what the user is actively watching.
+ *
+ * Auto Removal
+ *
+ * When an item is watched, it will be automatically removed from the watchlist. For shows and seasons, watching 1
+ * episode will remove the entire show or season.
+ *
+ * @see #watchlistMovies(UserSlug, String, String, Integer, Integer, Extended)
*/
@GET("users/{username}/watchlist/movies")
Call
+ * The specified order will be sent in the X-Applied-Sort-By and X-Applied-Sort-How headers.
*
- * Returns all items in a user's watchlist filtered by shows. When an item is watched, it will be automatically
- * removed from the watchlist. To track what the user is actively watching, use the progress APIs.
+ * Some sort_by options are VIP Only including imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore,
+ * votes, imdb_votes, and tmdb_votes. If sent for a non VIP, the items will fall back to rank.
+ *
+ * @param sortBy Sort by a specific property. Possible values: rank, added, title, released , runtime, popularity,
+ * random, percentage, imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore, votes,
+ * imdb_votes, tmdb_votes, my_rating, watched, collected.
+ * @param sortHow Sort direction. Possible values: asc, desc.
+ */
+ @GET("users/{username}/watchlist/movies/{sort_by}/{sort_how}")
+ Call
+ * Returns all items in a user's watchlist filtered by shows.
+ *
+ * The watchlist should not be used as a list of what the user is actively watching. Use a combination of the
+ * /sync/watched and /shows/:id/progress methods to get what the user is actively watching.
+ *
+ * Auto Removal
+ *
+ * When an item is watched, it will be automatically removed from the watchlist. For shows and seasons, watching 1
+ * episode will remove the entire show or season.
+ *
+ * @see #watchlistShows(UserSlug, String, String, Integer, Integer, Extended)
*/
@GET("users/{username}/watchlist/shows")
Call
+ * The specified order will be sent in the X-Applied-Sort-By and X-Applied-Sort-How headers.
*
- * Returns all items in a user's watchlist filtered by seasons. When an item is watched, it will be automatically
- * removed from the watchlist. To track what the user is actively watching, use the progress APIs.
+ * Some sort_by options are VIP Only including imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore,
+ * votes, imdb_votes, and tmdb_votes. If sent for a non VIP, the items will fall back to rank.
+ *
+ * @param sortBy Sort by a specific property. Possible values: rank, added, title, released , runtime, popularity,
+ * random, percentage, imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore, votes,
+ * imdb_votes, tmdb_votes, my_rating, watched, collected.
+ * @param sortHow Sort direction. Possible values: asc, desc.
+ */
+ @GET("users/{username}/watchlist/shows/{sort_by}/{sort_how}")
+ Call
+ * Returns all items in a user's watchlist filtered by seasons.
+ *
+ * The watchlist should not be used as a list of what the user is actively watching. Use a combination of the
+ * /sync/watched and /shows/:id/progress methods to get what the user is actively watching.
+ *
+ * Auto Removal
+ *
+ * When an item is watched, it will be automatically removed from the watchlist. For shows and seasons, watching 1
+ * episode will remove the entire show or season.
+ *
+ * @see #watchlistSeasons(UserSlug, String, String, Integer, Integer, Extended)
*/
@GET("users/{username}/watchlist/seasons")
Call
- * Returns all items in a user's watchlist filtered by episodes. When an item is watched, it will be automatically
- * removed from the watchlist. To track what the user is actively watching, use the progress APIs.
+ * The specified order will be sent in the X-Applied-Sort-By and X-Applied-Sort-How headers.
+ *
+ * Some sort_by options are VIP Only including imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore,
+ * votes, imdb_votes, and tmdb_votes. If sent for a non VIP, the items will fall back to rank.
+ *
+ * @param sortBy Sort by a specific property. Possible values: rank, added, title, released , runtime, popularity,
+ * random, percentage, imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore, votes,
+ * imdb_votes, tmdb_votes, my_rating, watched, collected.
+ * @param sortHow Sort direction. Possible values: asc, desc.
+ */
+ @GET("users/{username}/watchlist/seasons/{sort_by}/{sort_how}")
+ Call
+ * Returns all items in a user's watchlist filtered by episodes.
+ *
+ * The watchlist should not be used as a list of what the user is actively watching. Use a combination of the
+ * /sync/watched and /shows/:id/progress methods to get what the user is actively watching.
+ *
+ * Auto Removal
+ *
+ * When an item is watched, it will be automatically removed from the watchlist. For shows and seasons, watching 1
+ * episode will remove the entire show or season.
+ *
+ * @see #watchlistEpisodes(UserSlug, String, String, Integer, Integer, Extended)
*/
@GET("users/{username}/watchlist/episodes")
Call
+ * The specified order will be sent in the X-Applied-Sort-By and X-Applied-Sort-How headers.
+ *
+ * Some sort_by options are VIP Only including imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore,
+ * votes, imdb_votes, and tmdb_votes. If sent for a non VIP, the items will fall back to rank.
+ *
+ * @param sortBy Sort by a specific property. Possible values: rank, added, title, released , runtime, popularity,
+ * random, percentage, imdb_rating, tmdb_rating, rt_tomatometer, rt_audience, metascore, votes,
+ * imdb_votes, tmdb_votes, my_rating, watched, collected.
+ * @param sortHow Sort direction. Possible values: asc, desc.
+ */
+ @GET("users/{username}/watchlist/episodes/{sort_by}/{sort_how}")
+ Call
* Returns all movies or shows a user has watched sorted by most plays.
*
@@ -473,7 +779,7 @@ Call
* Returns all movies or shows a user has watched sorted by most plays.
*
diff --git a/src/test/java/com/uwetrottmann/trakt5/BaseTestCase.java b/src/test/java/com/uwetrottmann/trakt5/BaseTestCase.java
index 3fcf6dcc..b1f48e8b 100644
--- a/src/test/java/com/uwetrottmann/trakt5/BaseTestCase.java
+++ b/src/test/java/com/uwetrottmann/trakt5/BaseTestCase.java
@@ -32,6 +32,8 @@
import com.uwetrottmann.trakt5.entities.Ratings;
import com.uwetrottmann.trakt5.entities.Stats;
import com.uwetrottmann.trakt5.entities.TraktError;
+import com.uwetrottmann.trakt5.entities.WatchlistedEpisode;
+import com.uwetrottmann.trakt5.entities.WatchlistedSeason;
import com.uwetrottmann.trakt5.enums.Type;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
@@ -210,6 +212,7 @@ public void assertShowStats(Stats stats) {
}
protected static void assertSyncMovies(List> replies(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> movies(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> shows(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> comments(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> collectionMovies(
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} required
+ *
> collectionMovies(
+ @Query("page") int page,
+ @Query("limit") int limit,
@Query(value = "extended", encoded = true) Extended extended
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> collectionShows(
@Query(value = "extended", encoded = true) Extended extended
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> collectionShows(
+ @Query("page") int page,
+ @Query("limit") int limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} required
+ *
> watchedMovies(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
+ *
> playback(
+ @Query("start_at") OffsetDateTime startAt,
+ @Query("end_at") OffsetDateTime endAt,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} required
+ *
> playback(
+ @Path("type") PlaybackType type,
+ @Query("start_at") OffsetDateTime startAt,
+ @Query("end_at") OffsetDateTime endAt,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> getPlayback(
@Query("limit") Integer limit
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> getPlaybackEpisodes(
@Query("limit") Integer limit
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> getPlaybackMovies(
@Query("limit") Integer limit
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> watchedShows(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
+ *
> history(
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended,
+ @Query("start_at") OffsetDateTime startAt,
+ @Query("end_at") OffsetDateTime endAt
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} required
+ *
> history(
+ @Path("type") HistoryType type,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended,
+ @Query("start_at") OffsetDateTime startAt,
+ @Query("end_at") OffsetDateTime endAt
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} required
+ *
> history(
+ @Path("type") HistoryType type,
+ @Path("id") int id,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended,
+ @Query("start_at") OffsetDateTime startAt,
+ @Query("end_at") OffsetDateTime endAt
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
watched_at UTC datetime to
@@ -176,7 +316,7 @@ Call> ratingsMovies(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> ratingsShows(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> ratingsSeasons(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> ratingsEpisodes(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> watchlistMovies(
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link Users#watchlistMovies(UserSlug, Integer, Integer, Extended)}.
*/
@GET("sync/watchlist/movies")
Call
> watchlistMovies(
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
@Query(value = "extended", encoded = true) Extended extended
);
/**
- * OAuth Required
+ * Like {@link Users#watchlistMovies(UserSlug, String, String, Integer, Integer, Extended)}.
+ */
+ @GET("sync/watchlist/movies/{sort_by}/{sort_how}")
+ Call
> watchlistMovies(
+ @Nonnull @Path("sort_by") String sortBy,
+ @Nonnull @Path("sort_how") String sortHow,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> watchlistShows(
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link Users#watchlistShows(UserSlug, Integer, Integer, Extended)}.
*/
@GET("sync/watchlist/shows")
Call
> watchlistShows(
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link Users#watchlistShows(UserSlug, String, String, Integer, Integer, Extended)}.
+ */
+ @GET("sync/watchlist/shows/{sort_by}/{sort_how}")
+ Call
> watchlistShows(
+ @Nonnull @Path("sort_by") String sortBy,
+ @Nonnull @Path("sort_how") String sortHow,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
@Query(value = "extended", encoded = true) Extended extended
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> watchlistSeasons(
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link Users#watchlistSeasons(UserSlug, Integer, Integer, Extended)}.
*/
@GET("sync/watchlist/seasons")
Call
> watchlistSeasons(
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link Users#watchlistSeasons(UserSlug, String, String, Integer, Integer, Extended)}.
+ */
+ @GET("sync/watchlist/seasons/{sort_by}/{sort_how}")
+ Call
> watchlistSeasons(
+ @Nonnull @Path("sort_by") String sortBy,
+ @Nonnull @Path("sort_how") String sortHow,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
@Query(value = "extended", encoded = true) Extended extended
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> watchlistEpisodes(
@@ -335,7 +537,29 @@ Call
> watchlistEpisodes(
);
/**
- * OAuth Required
+ * Like {@link Users#watchlistEpisodes(UserSlug, Integer, Integer, Extended)}.
+ */
+ @GET("sync/watchlist/episodes")
+ Call
> watchlistEpisodes(
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link Users#watchlistEpisodes(UserSlug, String, String, Integer, Integer, Extended)}.
+ */
+ @GET("sync/watchlist/episodes/{sort_by}/{sort_how}")
+ Call
> watchlistEpisodes(
+ @Nonnull @Path("sort_by") String sortBy,
+ @Nonnull @Path("sort_how") String sortHow,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> collectionMovies(
@Path("username") UserSlug userSlug,
@@ -92,21 +96,59 @@ Call
> collectionMovies(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> collectionMovies(
+ @Path("username") UserSlug userSlug,
+ @Query("page") int page,
+ @Query("limit") int limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
+ *
> collectionShows(
+ @Path("username") UserSlug userSlug,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
+ *
> collectionShows(
@Path("username") UserSlug userSlug,
+ @Query("page") int page,
+ @Query("limit") int limit,
@Query(value = "extended", encoded = true) Extended extended
);
/**
- * VIP Only, OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> notes(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> lists(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> listItems(
@Path("username") UserSlug userSlug,
@@ -190,7 +235,96 @@ Call
> listItems(
);
/**
- * OAuth Required
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
+ *
> listItems(
+ @Path("username") UserSlug userSlug,
+ @Path("id") String id,
+ @Query("page") int page,
+ @Query("limit") int limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link #listItems(UserSlug, String, int, int, Extended)}, but you can specify a sort order.
+ *
> listItems(
+ @Path("username") UserSlug userSlug,
+ @Path("id") String id,
+ @Path("sort_by") String sortBy,
+ @Path("sort_how") String sortHow,
+ @Query("page") int page,
+ @Query("limit") int limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link #listItems(UserSlug, String, int, int, Extended)}, but you can specify the type parameter with a
+ * single value or comma-delimited string for multiple item types.
+ *
+ * @param type Filter for a specific item type. Example: {@code movie,show}. Possible values: movie, show, season,
+ * episode, person.
+ */
+ @GET("users/{username}/lists/{id}/items/{type}")
+ Call
> listItems(
+ @Path("username") UserSlug userSlug,
+ @Path("id") String id,
+ @Path("type") String type,
+ @Query("page") int page,
+ @Query("limit") int limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link #listItems(UserSlug, String, String, int, int, Extended)}, but you can specify a sort order.
+ *
> listItems(
+ @Path("username") UserSlug userSlug,
+ @Path("id") String id,
+ @Path("type") String type,
+ @Path("sort_by") String sortBy,
+ @Path("sort_how") String sortHow,
+ @Query("page") int page,
+ @Query("limit") int limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} required
*
> followers(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> following(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> friends(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> friends(
* {@code watch}.
*
* @param userSlug Example: "sean".
+ * @see Sync#history(Integer, Integer, Extended, OffsetDateTime, OffsetDateTime)
*/
@GET("users/{username}/history")
Call
> history(
@@ -304,15 +439,13 @@ Call
> history(
);
/**
- * OAuth Optional
- *
> history(
@@ -326,7 +459,7 @@ Call
> history(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> history(
* {@code watch}.
*
* @param userSlug Example: "sean".
+ * @see Sync#history(HistoryType, int, Integer, Integer, Extended, OffsetDateTime, OffsetDateTime)
*/
@GET("users/{username}/history/{type}/{id}")
Call
> history(
@@ -352,7 +486,7 @@ Call
> history(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> ratingsMovies(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> ratingsShows(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> ratingsSeasons(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> ratingsEpisodes(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> watchlistMovies(
- @Path("username") UserSlug userSlug,
+ @Nonnull @Path("username") UserSlug userSlug,
@Query(value = "extended", encoded = true) Extended extended
);
/**
- * OAuth Optional
+ * Like {@link #watchlistMovies(UserSlug, Extended)}, but you can specify pagination parameters.
+ */
+ @GET("users/{username}/watchlist/movies")
+ Call
> watchlistMovies(
+ @Nonnull @Path("username") UserSlug userSlug,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link #watchlistMovies(UserSlug, Extended)}, but you can specify pagination parameters and a sort order.
+ *
> watchlistMovies(
+ @Nonnull @Path("username") UserSlug userSlug,
+ @Nonnull @Path("sort_by") String sortBy,
+ @Nonnull @Path("sort_how") String sortHow,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
+ *
> watchlistShows(
- @Path("username") UserSlug userSlug,
+ @Nonnull @Path("username") UserSlug userSlug,
@Query(value = "extended", encoded = true) Extended extended
);
/**
- * OAuth Optional
+ * Like {@link #watchlistShows(UserSlug, Extended)}, but you can specify pagination parameters.
+ */
+ @GET("users/{username}/watchlist/shows")
+ Call
> watchlistShows(
+ @Nonnull @Path("username") UserSlug userSlug,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link #watchlistShows(UserSlug, Extended)}, but you can specify pagination parameters and a sort order.
+ *
> watchlistShows(
+ @Nonnull @Path("username") UserSlug userSlug,
+ @Nonnull @Path("sort_by") String sortBy,
+ @Nonnull @Path("sort_how") String sortHow,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
+ *
> watchlistSeasons(
- @Path("username") UserSlug userSlug,
+ @Nonnull @Path("username") UserSlug userSlug,
@Query(value = "extended", encoded = true) Extended extended
);
/**
- * OAuth Optional
+ * Like {@link #watchlistSeasons(UserSlug, Extended)}, but you can specify pagination parameters.
+ */
+ @GET("users/{username}/watchlist/seasons")
+ Call
> watchlistSeasons(
+ @Nonnull @Path("username") UserSlug userSlug,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link #watchlistSeasons(UserSlug, Extended)}, but you can specify pagination parameters and a sort order.
*
> watchlistSeasons(
+ @Nonnull @Path("username") UserSlug userSlug,
+ @Nonnull @Path("sort_by") String sortBy,
+ @Nonnull @Path("sort_how") String sortHow,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
+ *
> watchlistEpisodes(
- @Path("username") UserSlug userSlug,
+ @Nonnull @Path("username") UserSlug userSlug,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link #watchlistEpisodes(UserSlug, Extended)}, but you can specify pagination parameters.
+ */
+ @GET("users/{username}/watchlist/episodes")
+ Call
> watchlistEpisodes(
+ @Nonnull @Path("username") UserSlug userSlug,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
+ @Query(value = "extended", encoded = true) Extended extended
+ );
+
+ /**
+ * Like {@link #watchlistEpisodes(UserSlug, Extended)}, but you can specify pagination parameters and a sort order.
+ *
> watchlistEpisodes(
+ @Nonnull @Path("username") UserSlug userSlug,
+ @Nonnull @Path("sort_by") String sortBy,
+ @Nonnull @Path("sort_how") String sortHow,
+ @Query("page") Integer page,
+ @Query("limit") Integer limit,
@Query(value = "extended", encoded = true) Extended extended
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> watchedMovies(
);
/**
- * OAuth Optional
+ * OAuth {@link TraktV2#accessToken(String) access token} optional
*
> call = getTrakt().sync().ratingsMovies(RatingsFilter.ALL, null, 1, 2);
+ int page = 1;
+ int limit = 2;
+ Call
> call = getTrakt().sync().ratingsMovies(RatingsFilter.ALL, null, page, limit);
Response
> response = executeCallWithoutReadingBody(call);
- assertThat(response.headers().get("X-Pagination-Page-Count")).isNotEmpty();
- assertThat(response.headers().get("X-Pagination-Item-Count")).isNotEmpty();
+
+ assertPaginationHeaders(response, page, limit);
}
@Test
@@ -398,10 +407,12 @@ public void test_ratingsShows() throws IOException {
@Test
public void test_ratingsShows_with_pagination() throws IOException {
- Call
> call = getTrakt().sync().ratingsShows(RatingsFilter.ALL, null, 1, 2);
+ int page = 1;
+ int limit = 2;
+ Call
> call = getTrakt().sync().ratingsShows(RatingsFilter.ALL, null, page, limit);
Response
> response = executeCallWithoutReadingBody(call);
- assertThat(response.headers().get("X-Pagination-Page-Count")).isNotEmpty();
- assertThat(response.headers().get("X-Pagination-Item-Count")).isNotEmpty();
+
+ assertPaginationHeaders(response, page, limit);
}
@Test
@@ -413,10 +424,12 @@ public void test_ratingsSeasons() throws IOException {
@Test
public void test_ratingsSeasons_with_pagination() throws IOException {
- Call
> call = getTrakt().sync().ratingsSeasons(RatingsFilter.ALL, null, 1, 5);
+ int page = 1;
+ int limit = 5;
+ Call
> call = getTrakt().sync().ratingsSeasons(RatingsFilter.ALL, null, page, limit);
Response
> response = executeCallWithoutReadingBody(call);
- assertThat(response.headers().get("X-Pagination-Page-Count")).isNotEmpty();
- assertThat(response.headers().get("X-Pagination-Item-Count")).isNotEmpty();
+
+ assertPaginationHeaders(response, page, limit);
}
@Test
@@ -428,10 +441,12 @@ public void test_ratingsEpisodes() throws IOException {
@Test
public void test_ratingsEpisodes_with_pagination() throws IOException {
- Call
> call = getTrakt().sync().ratingsEpisodes(RatingsFilter.ALL, null, 1, 2);
+ int page = 1;
+ int limit = 2;
+ Call
> call = getTrakt().sync().ratingsEpisodes(RatingsFilter.ALL, null, page, limit);
Response
> response = executeCallWithoutReadingBody(call);
- assertThat(response.headers().get("X-Pagination-Page-Count")).isNotEmpty();
- assertThat(response.headers().get("X-Pagination-Item-Count")).isNotEmpty();
+
+ assertPaginationHeaders(response, page, limit);
}
@Test
@@ -514,36 +529,78 @@ public void test_watchlistMovies() throws IOException {
assertSyncMovies(movies, "watchlist");
}
+ @Test
+ public void test_watchlistMovies_pagination() throws IOException {
+ Response
> response = executeCallWithoutReadingBody(
+ getTrakt().sync().watchlistMovies(1, 10, null));
+ assertPaginationHeaders(response, 1, 10);
+ }
+
+ @Test
+ public void test_watchlistMovies_sortOrder() throws IOException {
+ Response
> response = executeCallWithoutReadingBody(
+ getTrakt().sync().watchlistMovies("title", "asc", null, null, null));
+ assertSortOrderHeaders(response, "title", "asc");
+ }
+
@Test
public void test_watchlistShows() throws IOException {
List
> response = executeCallWithoutReadingBody(
+ getTrakt().sync().watchlistShows(1, 10, null));
+ assertPaginationHeaders(response, 1, 10);
+ }
+
+ @Test
+ public void test_watchlistShows_sortOrder() throws IOException {
+ Response
> response = executeCallWithoutReadingBody(
+ getTrakt().sync().watchlistShows("title", "asc", null, null, null));
+ assertSortOrderHeaders(response, "title", "asc");
}
@Test
public void test_watchlistSeasons() throws IOException {
List
> response = executeCallWithoutReadingBody(
+ getTrakt().sync().watchlistSeasons(1, 10, null));
+ assertPaginationHeaders(response, 1, 10);
+ }
+
+ @Test
+ public void test_watchlistSeasons_sortOrder() throws IOException {
+ Response
> response = executeCallWithoutReadingBody(
+ getTrakt().sync().watchlistSeasons("title", "asc", null, null, null));
+ assertSortOrderHeaders(response, "title", "asc");
}
@Test
public void test_watchlistEpisodes() throws IOException {
List
> response = executeCallWithoutReadingBody(
+ getTrakt().sync().watchlistEpisodes(1, 10, null));
+ assertPaginationHeaders(response, 1, 10);
+ }
+
+ @Test
+ public void test_watchlistEpisodes_sortOrder() throws IOException {
+ Response
> response = executeCallWithoutReadingBody(
+ getTrakt().sync().watchlistEpisodes("title", "asc", null, null, null));
+ assertSortOrderHeaders(response, "title", "asc");
}
@Test
@@ -615,6 +672,60 @@ public void test_deleteItemsFromWatchlist() throws IOException {
assertSyncResponseDelete(requestResponse);
}
+ @Test
+ public void test_history() throws IOException {
+ List
> call = getTrakt().sync().history(page, limit, null, null, null);
+ Response
> response = executeCallWithoutReadingBody(call);
+
+ assertPaginationHeaders(response, page, limit);
+
+ List