From 289538dbeb7e92d673e0bb476b601d1c3844af2b Mon Sep 17 00:00:00 2001 From: martbost Date: Sun, 6 Sep 2026 08:21:59 -0500 Subject: [PATCH] =?UTF-8?q?NAS:=20adtype=20is=20an=20integer=20column=20(1?= =?UTF-8?q?),=20not=20a=20string=20=E2=80=94=20fixes=20sponsorads=20insert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- nas.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nas.js b/nas.js index 6e0685c..b012f0f 100644 --- a/nas.js +++ b/nas.js @@ -43,8 +43,11 @@ function impressionsPerCredit(type) { return type === 'banner' ? 5 : type === 'text' ? 10 : type === 'video' ? 0 : 0; } function nasKind(type) { - if (type === 'banner') return { pid: 2, adtype: 'banner' }; - if (type === 'text') return { pid: 1, adtype: 'text' }; + // pid encodes text(1)/banner(2); adtype is a separate small int — 1 is the + // value the overwhelming majority of live NAS rows use for both formats. + const adtype = Number(process.env.NAS_ADTYPE || 1); + if (type === 'banner') return { pid: 2, adtype }; + if (type === 'text') return { pid: 1, adtype }; return null; // only banner/text syndicate to NAS in v1 (login/solo/video are IAP-native) }