Skip to content

Commit

Permalink
Implemented paging on index_search
Browse files Browse the repository at this point in the history
  • Loading branch information
Yandawl committed Jan 17, 2021
1 parent 4237250 commit 7d501c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyxivapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__author__ = 'Lethys'
__license__ = 'MIT'
__copyright__ = 'Copyright 2019 (c) Lethys'
__version__ = '0.4.0'
__version__ = '0.5.0'

from .client import XIVAPIClient
from .exceptions import (
Expand Down
6 changes: 4 additions & 2 deletions pyxivapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ async def pvpteam_by_id(self, lodestone_id):
return await self.process_response(response)

@timed
async def index_search(self, name, indexes=(), columns=(), filters: List[Filter] = (), sort: Sort = None, page=1, language="en", string_algo="match"):
async def index_search(self, name, indexes=(), columns=(), filters: List[Filter] = (), sort: Sort = None, page=1, per_page=10, language="en", string_algo="match"):
"""|coro|
Search for data from on specific indexes.
Parameters
Expand Down Expand Up @@ -303,7 +303,9 @@ async def index_search(self, name, indexes=(), columns=(), filters: List[Filter]
}
}]
}
}
},
"from": (page * per_page),
"size": per_page
}
}

Expand Down

0 comments on commit 7d501c8

Please sign in to comment.