recentlyPlayed method

CursorPages<PlayHistory> recentlyPlayed({
  1. int? limit,
  2. DateTime? after,
  3. DateTime? before,
})

Get tracks from the current user’s recently played tracks. Note: Currently doesn’t support podcast episodes.

Implementation

CursorPages<PlayHistory> recentlyPlayed(
    {int? limit, DateTime? after, DateTime? before}) {
  assert(after == null || before == null,
      'Cannot specify both after and before.');

  return _getCursorPages(
      '$_path/player/recently-played?${_buildQuery({
            'limit': limit,
            'after': after?.millisecondsSinceEpoch,
            'before': before?.millisecondsSinceEpoch
          })}',
      (json) => PlayHistory.fromJson(json));
}