|
29 | 29 | import com.uwetrottmann.trakt5.entities.SyncItems; |
30 | 30 | import com.uwetrottmann.trakt5.entities.SyncResponse; |
31 | 31 | import com.uwetrottmann.trakt5.entities.UserSlug; |
| 32 | +import com.uwetrottmann.trakt5.entities.WatchedEpisode; |
32 | 33 | import com.uwetrottmann.trakt5.entities.WatchlistedEpisode; |
33 | 34 | import com.uwetrottmann.trakt5.entities.WatchlistedSeason; |
34 | 35 | import com.uwetrottmann.trakt5.enums.Extended; |
| 36 | +import com.uwetrottmann.trakt5.enums.ExtendedMoviesWatched; |
| 37 | +import com.uwetrottmann.trakt5.enums.ExtendedShowsWatched; |
35 | 38 | import com.uwetrottmann.trakt5.enums.HistoryType; |
36 | 39 | import com.uwetrottmann.trakt5.enums.PlaybackType; |
37 | 40 | import com.uwetrottmann.trakt5.enums.RatingsFilter; |
|
46 | 49 |
|
47 | 50 | import javax.annotation.Nonnull; |
48 | 51 | import java.util.List; |
| 52 | +import java.util.Map; |
49 | 53 |
|
50 | 54 | public interface Sync { |
51 | 55 |
|
@@ -139,12 +143,38 @@ Call<SyncResponse> deleteItemsFromCollection( |
139 | 143 | * <b>OAuth {@link TraktV2#accessToken(String) access token} required</b> |
140 | 144 | * <p> |
141 | 145 | * Returns all movies a user has watched. |
| 146 | + * |
| 147 | + * @deprecated Use {@link #watchedMovies(int, int, ExtendedMoviesWatched)} instead. |
142 | 148 | */ |
| 149 | + @Deprecated |
143 | 150 | @GET("sync/watched/movies") |
144 | 151 | Call<List<BaseMovie>> watchedMovies( |
145 | 152 | @Query(value = "extended", encoded = true) Extended extended |
146 | 153 | ); |
147 | 154 |
|
| 155 | + /** |
| 156 | + * <b>OAuth {@link TraktV2#accessToken(String) access token} required</b> |
| 157 | + * <p> |
| 158 | + * Like {@link Users#watchedMovies(UserSlug, int, int, ExtendedMoviesWatched)}. |
| 159 | + */ |
| 160 | + @GET("sync/watched/movies") |
| 161 | + Call<List<BaseMovie>> watchedMovies( |
| 162 | + @Query("page") int page, |
| 163 | + @Query("limit") int limit, |
| 164 | + @Query(value = "extended", encoded = true) ExtendedMoviesWatched extended |
| 165 | + ); |
| 166 | + |
| 167 | + /** |
| 168 | + * <b>OAuth {@link TraktV2#accessToken(String) access token} required</b> |
| 169 | + * <p> |
| 170 | + * Like {@link Users#watchedMoviesMin(UserSlug, int, int)}. |
| 171 | + */ |
| 172 | + @GET("sync/watched/movies?extended=min") |
| 173 | + Call<Map<String, List<OffsetDateTime>>> watchedMoviesMin( |
| 174 | + @Query("page") int page, |
| 175 | + @Query("limit") int limit |
| 176 | + ); |
| 177 | + |
148 | 178 | /** |
149 | 179 | * <b>OAuth {@link TraktV2#accessToken(String) access token} required</b> |
150 | 180 | * <p> |
@@ -243,12 +273,74 @@ Call<Void> removePlayback( |
243 | 273 | * <b>OAuth {@link TraktV2#accessToken(String) access token} required</b> |
244 | 274 | * <p> |
245 | 275 | * Returns all shows a user has watched. |
| 276 | + * |
| 277 | + * @deprecated Use {@link #watchedShows(int, int, ExtendedShowsWatched)} instead. |
246 | 278 | */ |
| 279 | + @Deprecated |
247 | 280 | @GET("sync/watched/shows") |
248 | 281 | Call<List<BaseShow>> watchedShows( |
249 | 282 | @Query(value = "extended", encoded = true) Extended extended |
250 | 283 | ); |
251 | 284 |
|
| 285 | + /** |
| 286 | + * <b>OAuth {@link TraktV2#accessToken(String) access token} required</b> |
| 287 | + * <p> |
| 288 | + * Like {@link Users#watchedShows(UserSlug, int, int, ExtendedShowsWatched)}. |
| 289 | + */ |
| 290 | + @GET("sync/watched/shows") |
| 291 | + Call<List<BaseShow>> watchedShows( |
| 292 | + @Query("page") int page, |
| 293 | + @Query("limit") int limit, |
| 294 | + @Query(value = "extended", encoded = true) ExtendedShowsWatched extended |
| 295 | + ); |
| 296 | + |
| 297 | + /** |
| 298 | + * <b>OAuth {@link TraktV2#accessToken(String) access token} required</b> |
| 299 | + * <p> |
| 300 | + * Like {@link Users#watchedShowsMin(UserSlug, int, int)}. |
| 301 | + */ |
| 302 | + @GET("sync/watched/shows?extended=min") |
| 303 | + Call<Map<String, Map<String, Map<String, List<OffsetDateTime>>>>> watchedShowsMin( |
| 304 | + @Query("page") int page, |
| 305 | + @Query("limit") int limit |
| 306 | + ); |
| 307 | + |
| 308 | + /** |
| 309 | + * <b>OAuth {@link TraktV2#accessToken(String) access token} required</b> |
| 310 | + * <p> |
| 311 | + * Returns all episodes a user has watched. |
| 312 | + * |
| 313 | + * @param page Number of page of results to be returned. |
| 314 | + * @param limit Number of results to return per page. |
| 315 | + */ |
| 316 | + @GET("sync/watched/episodes") |
| 317 | + Call<List<WatchedEpisode>> watchedEpisodes( |
| 318 | + @Query("page") int page, |
| 319 | + @Query("limit") int limit |
| 320 | + ); |
| 321 | + |
| 322 | + /** |
| 323 | + * <b>OAuth {@link TraktV2#accessToken(String) access token} required</b> |
| 324 | + * <p> |
| 325 | + * Returns episode Trakt IDs mapped to a list of watched at timestamps. |
| 326 | + * <p> |
| 327 | + * An example for an equivalent JSON for a single episode with three watched at timestamps: |
| 328 | + * <pre> |
| 329 | + * { |
| 330 | + * "73482": [ |
| 331 | + * "2015-02-10T09:04:00.000Z", |
| 332 | + * "2015-02-10T15:42:00.000Z", |
| 333 | + * "2015-02-24T05:51:00.000Z" |
| 334 | + * ] |
| 335 | + * } |
| 336 | + * </pre> |
| 337 | + */ |
| 338 | + @GET("sync/watched/episodes?extended=min") |
| 339 | + Call<Map<String, List<OffsetDateTime>>> watchedEpisodesMin( |
| 340 | + @Query("page") int page, |
| 341 | + @Query("limit") int limit |
| 342 | + ); |
| 343 | + |
252 | 344 | /** |
253 | 345 | * <b>OAuth {@link TraktV2#accessToken(String) access token} required</b> |
254 | 346 | * <p> |
|
0 commit comments