Compare commits

..

No commits in common. "16f43066a42bc5089a6333cde62d2573e19f0640" and "5ac7cfbc9a7c44fe1591f4cf6d4cc4ddaaa6bfe6" have entirely different histories.

3 changed files with 9 additions and 18 deletions

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{ {
"name": "traxxx-web", "name": "traxxx-web",
"version": "0.42.24", "version": "0.42.23",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "0.42.24", "version": "0.42.23",
"dependencies": { "dependencies": {
"@brillout/json-serializer": "^0.5.8", "@brillout/json-serializer": "^0.5.8",
"@dicebear/collection": "^7.0.5", "@dicebear/collection": "^7.0.5",

View File

@ -87,7 +87,7 @@
"overrides": { "overrides": {
"vite": "$vite" "vite": "$vite"
}, },
"version": "0.42.24", "version": "0.42.23",
"imports": { "imports": {
"#/*": "./*.js" "#/*": "./*.js"
} }

View File

@ -25,16 +25,12 @@ export function getAffiliateSceneUrl(scene) {
return watchUrl; return watchUrl;
} }
const affiliateUrl = scene.affiliate.parameters.replace?.hostname === new URL(watchUrl).hostname if (scene.affiliate.url?.includes('/track')
? scene.affiliate.parameters.replace.url
: scene.affiliate.url;
if (affiliateUrl?.includes('/track')
&& scene.affiliate.parameters.scene !== false && scene.affiliate.parameters.scene !== false
&& (!scene.channel.isIndependent || scene.channel.id === scene.affiliate.entityId)) { // standard NATS redirect && (!scene.channel.isIndependent || scene.channel.id === scene.affiliate.entityId)) { // standard NATS redirect
const { pathname, search } = new URL(watchUrl); const { pathname, search } = new URL(watchUrl);
return `${affiliateUrl}${pathname.replace(/^\/trial/, '')}${search}`; // replace needed for Jules Jordan, verify behavior on other sites return `${scene.affiliate.url}${pathname.replace(/^\/trial/, '')}${search}`; // replace needed for Jules Jordan, verify behavior on other sites
} }
if (scene.affiliate.parameters.query) { // used by e.g. Bang if (scene.affiliate.parameters.query) { // used by e.g. Bang
@ -54,28 +50,23 @@ export function getAffiliateEntityUrl(entity) {
return entity.url; return entity.url;
} }
const affiliateUrl = entity.affiliate.parameters.replace?.hostname === new URL(entity.url).hostname
? entity.affiliate.parameters.replace.url
: entity.affiliate.url;
if (entity.id === entity.affiliate.entityId) { if (entity.id === entity.affiliate.entityId) {
return affiliateUrl; return entity.affiliate.url;
} }
if (entity.type === 'network' || entity.isIndependent) { if (entity.type === 'network' || entity.isIndependent) {
return entity.url; return entity.url;
} }
// channel has its own domain if (new URL(entity.url).hostname !== new URL(entity.affiliate.url).hostname) {
if (new URL(entity.url).pathname === '/') {
return entity.url; return entity.url;
} }
if (affiliateUrl?.includes('/track') if (entity.affiliate.url?.includes('/track')
&& entity.affiliate.parameters.channel !== false) { && entity.affiliate.parameters.channel !== false) {
const { pathname, search } = new URL(entity.url); const { pathname, search } = new URL(entity.url);
return `${affiliateUrl}${pathname.replace(/^\/trial/, '')}${search}`; // replace needed for Jules Jordan, verify behavior on other sites return `${entity.affiliate.url}${pathname.replace(/^\/trial/, '')}${search}`; // replace needed for Jules Jordan, verify behavior on other sites
} }
if (entity.affiliate.parameters.query) { // used by e.g. Bang if (entity.affiliate.parameters.query) { // used by e.g. Bang