Handling independent channel banner configurations.

This commit is contained in:
DebaucheryLibrarian
2026-02-07 17:00:41 +01:00
parent d0f12c774d
commit 4dd236d5da

View File

@@ -1070,16 +1070,19 @@ exports.seed = async (knex) => {
const affiliate = affiliates.find((aff) => aff.id === affiliateId) const affiliate = affiliates.find((aff) => aff.id === affiliateId)
|| affiliates.find((aff) => aff.channel === resolvedChannel) || 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) { if (!affiliate) {
console.warn('UNMATCHED AFFILIATE', file); console.warn('UNMATCHED AFFILIATE', file);
} }
const isIndependent = affiliate?.channel && affiliate.channel === resolvedNetwork;
return { return {
file, file,
network: resolvedNetwork, network: isIndependent ? null : resolvedNetwork,
channel: resolvedChannel, channel: isIndependent ? resolvedNetwork : resolvedChannel,
affiliateId, affiliateId,
affiliate: getAffiliateId(affiliate), affiliate: getAffiliateId(affiliate),
banner, banner,