mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-08-19 06:15:47 +00:00
SKIP_EXTRA_NAME added to constants
This commit is contained in:
parent
5e703517f8
commit
8bb1687fb4
2 changed files with 7 additions and 5 deletions
|
|
@ -3,11 +3,13 @@ const SUBTITLES_FONTS = ['Roboto', 'Arial', 'Halvetica', 'Times New Roman', 'Ver
|
|||
const CATALOG_PREVIEW_SIZE = 10;
|
||||
const CATALOG_PAGE_SIZE = 100;
|
||||
const NONE_EXTRA_VALUE = 'None';
|
||||
const SKIP_EXTRA_NAME = 'skip';
|
||||
|
||||
module.exports = {
|
||||
SUBTITLES_SIZES,
|
||||
SUBTITLES_FONTS,
|
||||
CATALOG_PREVIEW_SIZE,
|
||||
CATALOG_PAGE_SIZE,
|
||||
NONE_EXTRA_VALUE
|
||||
NONE_EXTRA_VALUE,
|
||||
SKIP_EXTRA_NAME
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
const React = require('react');
|
||||
const { CONSTANTS } = require('stremio/common');
|
||||
|
||||
const SKIP_EXTRA = {
|
||||
name: 'skip',
|
||||
const SKIP_EXTRA_PROP = {
|
||||
name: CONSTANTS.SKIP_EXTRA_NAME,
|
||||
optionsLimit: 1,
|
||||
isRequired: false
|
||||
};
|
||||
|
|
@ -65,7 +65,7 @@ const mapSelectableInputs = (discover) => {
|
|||
}
|
||||
};
|
||||
const requestedPage = selectedCatalogRequest.path.extra.reduce((requestedPage, [name, value]) => {
|
||||
if (name === SKIP_EXTRA.name) {
|
||||
if (name === CONSTANTS.SKIP_EXTRA_NAME) {
|
||||
const skip = parseInt(value);
|
||||
if (isFinite(skip)) {
|
||||
return Math.floor(skip / CONSTANTS.CATALOG_PAGE_SIZE) + 1;
|
||||
|
|
@ -162,7 +162,7 @@ const mapSelectableInputs = (discover) => {
|
|||
resource: 'catalog',
|
||||
type_name: selectedCatalogRequest.path.type_name,
|
||||
id: selectedCatalogRequest.path.id,
|
||||
extra: getNextExtra(selectedCatalogRequest.path.extra, SKIP_EXTRA, nextValue)
|
||||
extra: getNextExtra(selectedCatalogRequest.path.extra, SKIP_EXTRA_PROP, nextValue)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue