getWatchlist method

Future<List<WatchlistItem>> getWatchlist({
  1. WatchedItemType? type,
  2. SortBy? sortBy,
  3. bool extendedFull = false,
  4. RequestPagination? pagination,
})

Returns all items in a user's watchlist filtered by type.

Sorting Headers

By default, all list items are sorted by rank asc. We send X-Applied-Sort-By and X-Applied-Sort-How headers to indicate how the results are actually being sorted.We also send X-Sort-By and X-Sort-How headers which indicate the user's sort preference. Use these to to custom sort the watchlist in your app for more advanced sort abilities we can't do in the API. Values for X-Sort-By include rank, added, title, released, runtime, popularity, percentage, and votes. Values for X-Sort-How include asc and desc.

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.

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.

type - Possible values: movies , shows , seasons , episodes. sortBy - How to sort (only if type is also sent). Possible values: rank , added , released , title .

🔒 OAuth Required 📄 Pagination Optional ✨ Extended Info

Implementation

Future<List<WatchlistItem>> getWatchlist(
    {WatchedItemType? type,
    SortBy? sortBy,
    bool extendedFull = false,
    RequestPagination? pagination}) async {
  var request = "sync/watchlist";
  if (type != null) {
    request += "/${type.value}";
    if (sortBy != null) {
      request += "/${sortBy.value}";
    }
  }

  return await _manager._authenticatedGetList<WatchlistItem>(request,
      extendedFull: extendedFull, pagination: pagination);
}