diff --git a/assets/components/campaigns/campaign.vue b/assets/components/campaigns/campaign.vue index 2a24e9d1..730b17e0 100755 --- a/assets/components/campaigns/campaign.vue +++ b/assets/components/campaigns/campaign.vue @@ -63,6 +63,10 @@ function entityCampaign() { return randomCampaign; } + if (this.allowGeneric) { + return this.genericCampaign(); + } + this.$emit('campaign', null); return null; @@ -84,6 +88,10 @@ function tagCampaign() { return randomCampaign; } + if (this.allowGeneric) { + return this.genericCampaign(); + } + this.$emit('campaign', null); return null; @@ -134,6 +142,10 @@ export default { type: Number, default: null, }, + allowGeneric: { + type: Boolean, + default: false, + }, maxRatio: { type: Number, default: null, diff --git a/assets/components/entities/entity.vue b/assets/components/entities/entity.vue index aee25c97..a823e4c9 100755 --- a/assets/components/entities/entity.vue +++ b/assets/components/entities/entity.vue @@ -114,6 +114,7 @@
@@ -157,14 +158,17 @@ async function fetchEntity(scroll = true) { const campaign = entity.campaigns.find((campaignX) => !campaignX.banner) || entity.parent?.campaigns.find((campaignX) => !campaignX.banner); - const { searchParams, pathname, origin } = new URL(entity.url); + if (entity.url) { + const { searchParams, pathname, origin } = new URL(entity.url); - const affiliateParams = new URLSearchParams({ - ...(entity.url && Object.fromEntries(searchParams)), // preserve any query in entity URL, e.g. ?siteId=5 - ...(campaign?.affiliate?.parameters && Object.fromEntries(new URLSearchParams(campaign.affiliate.parameters))), // append affiliate parameters - }).toString(); + const affiliateParams = new URLSearchParams({ + ...(entity.url && Object.fromEntries(searchParams)), // preserve any query in entity URL, e.g. ?siteId=5 + ...(campaign?.affiliate?.parameters && Object.fromEntries(new URLSearchParams(campaign.affiliate.parameters))), // append affiliate parameters + }).toString(); + + this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${origin}${pathname}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`; + } - this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${origin}${pathname}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`; this.done = true; if (scroll && this.$refs.filter?.$el) { diff --git a/assets/components/home/home.vue b/assets/components/home/home.vue index 07cf5d50..4022a056 100755 --- a/assets/components/home/home.vue +++ b/assets/components/home/home.vue @@ -76,7 +76,7 @@ export default { releases: [], networks: [], pageTitle: null, - limit: 30, + limit: 29, // reserve one campaign spot totalCount: 0, from: null, done: false, diff --git a/assets/components/releases/releases.vue b/assets/components/releases/releases.vue index ba1983d6..5db2ce93 100755 --- a/assets/components/releases/releases.vue +++ b/assets/components/releases/releases.vue @@ -12,18 +12,34 @@ :key="sfw" class="nolist tiles" > -
  • - -
  • + -