Video Spin zone (/vz/<code>): a rotating player for any web page; house Video Spin admin route
/vz/<code> sends a frame to Social Tube's small player for one of the spin's videos on each page view; no click is recorded for a view (rotator.peek), plays and taps are counted by Video App Income under the spin's code. Embed code on the Video Spin screen. vsCreate / vsAdd shared by the member routes and POST /api/admin/house-videospin (admin key, house account, admin action log). Chatbot lines updated (Marty 2026-11-22). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
+8
-1
@@ -220,6 +220,13 @@ function pick(r, cell) {
|
||||
return live[live.length - 1];
|
||||
}
|
||||
// the redirect: returns { url, dest } or null (unknown code). Records the hit.
|
||||
// A pick with no click recorded (Video Spin zone, 2026-11-22): the embedded player asks for a video on every page view, and a page view
|
||||
// is not a click. Same rules as a click: paused or off-hours gives no destination.
|
||||
async function peek(code) {
|
||||
const r = J.db.rotations.find(r => r.code === norm(code)); if (!r) return null;
|
||||
const cell = cellAt(zoneFor(r, '')); const off = !r.paused && !isOn(r.hours, cell);
|
||||
return { rotation: r, dest: (r.paused || off) ? null : pick(r, cell) };
|
||||
}
|
||||
async function resolve(code, req) {
|
||||
const r = J.db.rotations.find(r => r.code === norm(code)); if (!r) return null;
|
||||
const ua = String(req.headers['user-agent'] || ''); const bot = BOT.test(ua) || !ua;
|
||||
@@ -411,5 +418,5 @@ function adminAll() {
|
||||
destinations: (r.destinations || []).map(d => ({ id: d.id, url: d.url, label: d.label || '', weight: d.weight, active: !!d.active, autoPaused: d.autoPaused || 0, health: d.health ? { state: d.health.state, note: d.health.note || '', checkedAt: d.health.checkedAt || 0 } : null })),
|
||||
hits: o.hits, hits7: o.hits7, bots: o.bots, conversions: cv[r.id] || 0 }; });
|
||||
}
|
||||
module.exports = { eraseOwner, _json: { state: () => J.db, save: () => J.save() }, init, convRows, adminAll, hitById, list, get, create, update, remove, addDest, updateDest, resolve, stats, totals, convert, summary, createDemo, claim, sweepDemos, servedToday, window24,
|
||||
module.exports = { eraseOwner, _json: { state: () => J.db, save: () => J.save() }, init, convRows, adminAll, hitById, list, get, create, update, remove, addDest, updateDest, resolve, peek, stats, totals, convert, summary, createDemo, claim, sweepDemos, servedToday, window24,
|
||||
pub, rawRotations, save, findMine, setExternalConvert, PRESETS, cleanHours, cleanTz, cellAt, zoneFor, isOn, COUNTRY_TZ, sourceCounts, detachSource, ensureFixed, ensurePartner, partnerStats };
|
||||
|
||||
Reference in New Issue
Block a user