Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

530 B
Raw Blame
namespace API.Helpers;

public class UserParams
{
    private const int MaxPageSize = int.MaxValue;
    public int PageNumber { get; init; } = 1;
    private readonly int _pageSize = MaxPageSize;

    /// <summary>
    /// If set to 0, will set as MaxInt
    /// </summary>
    public int PageSize
    {
        get => _pageSize;
        init => _pageSize = (value == 0) ? MaxPageSize : value;
    }

    public static readonly UserParams Default = new UserParams()
    {
        PageSize = 20,
        PageNumber = 1
    };
}