Compare commits
2 Commits
57dfa621df
...
1c982124b0
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c982124b0 | |||
| 6aaa3ad30c |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "traxxx-web",
|
||||
"version": "0.46.4",
|
||||
"version": "0.46.5",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"version": "0.46.4",
|
||||
"version": "0.46.5",
|
||||
"dependencies": {
|
||||
"@brillout/json-serializer": "^0.5.8",
|
||||
"@dicebear/collection": "^7.0.5",
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
"overrides": {
|
||||
"vite": "$vite"
|
||||
},
|
||||
"version": "0.46.4",
|
||||
"version": "0.46.5",
|
||||
"imports": {
|
||||
"#/*": "./*.js"
|
||||
}
|
||||
|
||||
@@ -82,18 +82,27 @@ export async function getRandomCampaign(options = {}, context = {}, pass = 0) {
|
||||
|
||||
const validCampaigns = campaigns.filter((campaign) => {
|
||||
if (options.minRatio && (!campaign.banner || campaign.banner.ratio < options.minRatio)) {
|
||||
// too small
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.maxRatio && (!campaign.banner || campaign.banner.ratio > options.maxRatio)) {
|
||||
// too big
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.entityIds && !options.entityIds.some((entityId) => campaign.entity.id === entityId || campaign.entity.parent?.id === entityId)) {
|
||||
// this is an entity page, this campaign does not belong to this entity
|
||||
return false;
|
||||
}
|
||||
|
||||
if (campaign.affiliate?.parameters?.global === false && !options.entityIds) {
|
||||
// this campaign should only show on entity page
|
||||
return false;
|
||||
}
|
||||
|
||||
if (context.tagFilter && campaign.banner && campaign.banner.tags.some((tag) => context.tagFilter.includes(tag) && !options.tagSlugs?.includes(tag))) {
|
||||
// wrong tag
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
2
static
2
static
Submodule static updated: 4e5c91df28...13a0a44985
Reference in New Issue
Block a user