From 4dd236d5daef73e61261e15bf3664339c18ee052 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sat, 7 Feb 2026 17:00:41 +0100 Subject: [PATCH] Handling independent channel banner configurations. --- seeds/06_affiliates.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/seeds/06_affiliates.js b/seeds/06_affiliates.js index 2a523606..987012b1 100755 --- a/seeds/06_affiliates.js +++ b/seeds/06_affiliates.js @@ -1070,16 +1070,19 @@ exports.seed = async (knex) => { const affiliate = affiliates.find((aff) => aff.id === affiliateId) || affiliates.find((aff) => aff.channel === resolvedChannel) - || affiliates.find((aff) => aff.network === resolvedNetwork); + || affiliates.find((aff) => aff.network === resolvedNetwork) + || affiliates.find((aff) => aff.channel === resolvedNetwork); // independent channel if (!affiliate) { console.warn('UNMATCHED AFFILIATE', file); } + const isIndependent = affiliate?.channel && affiliate.channel === resolvedNetwork; + return { file, - network: resolvedNetwork, - channel: resolvedChannel, + network: isIndependent ? null : resolvedNetwork, + channel: isIndependent ? resolvedNetwork : resolvedChannel, affiliateId, affiliate: getAffiliateId(affiliate), banner,