diff --git a/src/controllers/movies/moviecollections.js b/src/controllers/movies/moviecollections.js index f17f64b7c8..bd47f1e82a 100644 --- a/src/controllers/movies/moviecollections.js +++ b/src/controllers/movies/moviecollections.js @@ -1,4 +1,4 @@ -define(["loading", "events", "libraryBrowser", "imageLoader", "listView", "cardBuilder", "apphost", "emby-itemscontainer"], function (loading, events, libraryBrowser, imageLoader, listView, cardBuilder, appHost) { +define(["loading", "events", "libraryBrowser", "imageLoader", "listView", "cardBuilder", "userSettings", "emby-itemscontainer"], function (loading, events, libraryBrowser, imageLoader, listView, cardBuilder, userSettings) { "use strict"; return function (view, params, tabContent) { @@ -16,11 +16,15 @@ define(["loading", "events", "libraryBrowser", "imageLoader", "listView", "cardB Fields: "PrimaryImageAspectRatio,SortName", ImageTypeLimit: 1, EnableImageTypes: "Primary,Backdrop,Banner,Thumb", - StartIndex: 0, - Limit: pageSize + StartIndex: 0 }, view: libraryBrowser.getSavedView(key) || "Poster" }; + + if (userSettings.libraryPageSize() > 0) { + pageData.query['Limit'] = userSettings.libraryPageSize(); + } + pageData.query.ParentId = params.topParentId; libraryBrowser.loadSavedQueryValues(key, pageData.query); } @@ -65,7 +69,9 @@ define(["loading", "events", "libraryBrowser", "imageLoader", "listView", "cardB return; } - query.StartIndex += query.Limit; + if (userSettings.libraryPageSize() > 0) { + query.StartIndex += query.Limit; + } reloadItems(tabContent); } @@ -74,7 +80,9 @@ define(["loading", "events", "libraryBrowser", "imageLoader", "listView", "cardB return; } - query.StartIndex -= query.Limit; + if (userSettings.libraryPageSize() > 0) { + query.StartIndex = Math.max(0, query.StartIndex - query.Limit); + } reloadItems(tabContent); }