Skip to content

Commit

Permalink
Fix show-selector for libraries with more than 1k shows (#5623)
Browse files Browse the repository at this point in the history
* Fix #5240 by bumping up the API pagination limit

* Update CHANGELOG.md
  • Loading branch information
sharkykh authored and medariox committed Nov 4, 2018
1 parent a123f7d commit 98f23bd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Fixed guessit exception when parsing release without title ([#5569](https://github.com/pymedusa/Medusa/pull/5569))
- Fixed Download Station BraceAdapter exception ([#5573](https://github.com/pymedusa/Medusa/pull/5573))
- Fixed saving multiple metadata providers ([#5576](https://github.com/pymedusa/Medusa/pull/5576))
- Fixed show-selector for libraries with more than 1k shows ([#5623](https://github.com/pymedusa/Medusa/pull/5623))

-----

Expand Down
2 changes: 1 addition & 1 deletion medusa/server/api/v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def _get_page(self):
except ValueError:
self._raise_bad_request_error('Invalid page parameter')

def _get_limit(self, default=20, maximum=1000):
def _get_limit(self, default=20, maximum=10000):
try:
limit = self._parse(self.get_argument('limit', default=default))
if limit < 1 or limit > maximum:
Expand Down
6 changes: 3 additions & 3 deletions themes-default/slim/src/store/modules/shows.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ const actions = {
* Get shows from API and commit them to the store.
*
* @param {*} context - The store context.
* @param {ShowParameteres[]} shows - Shows to get. If not provided, gets the first 1000 shows.
* @param {ShowParameteres[]} shows - Shows to get. If not provided, gets the first 10k shows.
* @returns {(undefined|Promise)} undefined if `shows` was provided or the API response if not.
*/
getShows(context, shows) {
const { commit, dispatch } = context;

// If no shows are provided get the first 1000
// If no shows are provided get the first 10k
if (!shows) {
const params = {
limit: 1000
limit: 10000
};
return api.get('/series', { params }).then(res => {
const shows = res.data;
Expand Down
2 changes: 1 addition & 1 deletion themes/dark/assets/js/medusa-runtime.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 98f23bd

Please sign in to comment.