mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 10:42:12 +00:00
rename addonTransportUrl param to transportUrl
This commit is contained in:
parent
263d1fe160
commit
02c20be5e9
7 changed files with 16 additions and 16 deletions
|
|
@ -9,7 +9,7 @@ const routesRegexp = {
|
|||
},
|
||||
discover: {
|
||||
regexp: /^\/discover(?:\/([^/]*)\/([^/]*)\/([^/]*))?$/,
|
||||
urlParamsNames: ['addonTransportUrl', 'type', 'catalogId']
|
||||
urlParamsNames: ['transportUrl', 'type', 'catalogId']
|
||||
},
|
||||
library: {
|
||||
regexp: /^\/library(?:\/([^/]*)\/([^/]*))?$/,
|
||||
|
|
@ -25,7 +25,7 @@ const routesRegexp = {
|
|||
},
|
||||
addons: {
|
||||
regexp: /^\/addons(?:\/([^/]*)\/([^/]*)\/([^/]*))?$/,
|
||||
urlParamsNames: ['addonTransportUrl', 'catalogId', 'type']
|
||||
urlParamsNames: ['transportUrl', 'catalogId', 'type']
|
||||
},
|
||||
settings: {
|
||||
regexp: /^\/settings$/,
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ const styles = require('./styles');
|
|||
const navigateToAddonDetails = (addonsCatalogRequest, transportUrl) => {
|
||||
const queryParams = new URLSearchParams([['addon', transportUrl]]);
|
||||
if (addonsCatalogRequest !== null) {
|
||||
const addonTransportUrl = encodeURIComponent(addonsCatalogRequest.base);
|
||||
const transportUrl = encodeURIComponent(addonsCatalogRequest.base);
|
||||
const catalogId = encodeURIComponent(addonsCatalogRequest.path.id);
|
||||
const type = encodeURIComponent(addonsCatalogRequest.path.type_name);
|
||||
window.location.replace(`#/addons/${addonTransportUrl}/${catalogId}/${type}?${queryParams}`);
|
||||
window.location.replace(`#/addons/${transportUrl}/${catalogId}/${type}?${queryParams}`);
|
||||
} else {
|
||||
window.location.replace(`#/addons?${queryParams}`);
|
||||
}
|
||||
|
|
@ -21,10 +21,10 @@ const navigateToAddonDetails = (addonsCatalogRequest, transportUrl) => {
|
|||
|
||||
const clearAddonDetails = (addonsCatalogRequest) => {
|
||||
if (addonsCatalogRequest !== null) {
|
||||
const addonTransportUrl = encodeURIComponent(addonsCatalogRequest.base);
|
||||
const transportUrl = encodeURIComponent(addonsCatalogRequest.base);
|
||||
const catalogId = encodeURIComponent(addonsCatalogRequest.path.id);
|
||||
const type = encodeURIComponent(addonsCatalogRequest.path.type_name);
|
||||
window.location.replace(`#/addons/${addonTransportUrl}/${catalogId}/${type}`);
|
||||
window.location.replace(`#/addons/${transportUrl}/${catalogId}/${type}`);
|
||||
} else {
|
||||
window.location.replace('#/addons');
|
||||
}
|
||||
|
|
@ -217,7 +217,7 @@ const Addons = ({ urlParams, queryParams }) => {
|
|||
|
||||
Addons.propTypes = {
|
||||
urlParams: PropTypes.exact({
|
||||
addonTransportUrl: PropTypes.string,
|
||||
transportUrl: PropTypes.string,
|
||||
catalogId: PropTypes.string,
|
||||
type: PropTypes.string
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -55,13 +55,13 @@ const onNewAddonsState = (addons) => {
|
|||
const useAddons = (urlParams) => {
|
||||
const { core } = useServices();
|
||||
const loadAddonsAction = React.useMemo(() => {
|
||||
if (typeof urlParams.addonTransportUrl === 'string' && typeof urlParams.catalogId === 'string' && typeof urlParams.type === 'string') {
|
||||
if (typeof urlParams.transportUrl === 'string' && typeof urlParams.catalogId === 'string' && typeof urlParams.type === 'string') {
|
||||
return {
|
||||
action: 'Load',
|
||||
args: {
|
||||
load: 'CatalogFiltered',
|
||||
args: {
|
||||
base: urlParams.addonTransportUrl,
|
||||
base: urlParams.transportUrl,
|
||||
path: {
|
||||
resource: 'addon_catalog',
|
||||
type_name: urlParams.type,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
const React = require('react');
|
||||
|
||||
const navigateWithLoadRequest = (load_request) => {
|
||||
const addonTransportUrl = encodeURIComponent(load_request.base);
|
||||
const transportUrl = encodeURIComponent(load_request.base);
|
||||
const catalogId = encodeURIComponent(load_request.path.id);
|
||||
const type = encodeURIComponent(load_request.path.type_name);
|
||||
window.location.replace(`#/addons/${addonTransportUrl}/${catalogId}/${type}`);
|
||||
window.location.replace(`#/addons/${transportUrl}/${catalogId}/${type}`);
|
||||
};
|
||||
|
||||
const equalWithouExtra = (request1, request2) => {
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ const Discover = ({ urlParams, queryParams }) => {
|
|||
|
||||
Discover.propTypes = {
|
||||
urlParams: PropTypes.exact({
|
||||
addonTransportUrl: PropTypes.string,
|
||||
transportUrl: PropTypes.string,
|
||||
type: PropTypes.string,
|
||||
catalogId: PropTypes.string
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -57,13 +57,13 @@ const onNewDiscoverState = (discover) => {
|
|||
const useDiscover = (urlParams, queryParams) => {
|
||||
const { core } = useServices();
|
||||
const loadDiscoverAction = React.useMemo(() => {
|
||||
if (typeof urlParams.addonTransportUrl === 'string' && typeof urlParams.type === 'string' && typeof urlParams.catalogId === 'string') {
|
||||
if (typeof urlParams.transportUrl === 'string' && typeof urlParams.type === 'string' && typeof urlParams.catalogId === 'string') {
|
||||
return {
|
||||
action: 'Load',
|
||||
args: {
|
||||
load: 'CatalogFiltered',
|
||||
args: {
|
||||
base: urlParams.addonTransportUrl,
|
||||
base: urlParams.transportUrl,
|
||||
path: {
|
||||
resource: 'catalog',
|
||||
type_name: urlParams.type,
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ const SKIP_EXTRA = {
|
|||
};
|
||||
|
||||
const navigateWithLoadRequest = (load_request) => {
|
||||
const addonTransportUrl = encodeURIComponent(load_request.base);
|
||||
const transportUrl = encodeURIComponent(load_request.base);
|
||||
const type = encodeURIComponent(load_request.path.type_name);
|
||||
const catalogId = encodeURIComponent(load_request.path.id);
|
||||
const extra = new URLSearchParams(load_request.path.extra).toString();
|
||||
window.location.replace(`#/discover/${addonTransportUrl}/${type}/${catalogId}?${extra}`);
|
||||
window.location.replace(`#/discover/${transportUrl}/${type}/${catalogId}?${extra}`);
|
||||
};
|
||||
|
||||
const getNextExtra = (prevExtra, extraProp, extraValue) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue