Deezer discographies for every DR artist; release features in the add model (recency, releases in the window); rankings 'if they release in the window' and blended by release rate; site switch and what-if release toggle
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+20
-8
@@ -118,6 +118,12 @@ svg text { fill: var(--muted); font-size: 11px; }
|
||||
<option value="p8jazz">P8 Jazz</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ctl">Assume
|
||||
<select id="mode">
|
||||
<option value="rel">They release in the window</option>
|
||||
<option value="mix">Their usual release rate</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ctl">Sort by
|
||||
<select id="sort">
|
||||
<option value="p">Chance of a new add</option>
|
||||
@@ -139,7 +145,7 @@ svg text { fill: var(--muted); font-size: 11px; }
|
||||
</table>
|
||||
</div>
|
||||
<button class="more" id="more" hidden>Show more</button>
|
||||
<p class="note">"In rotation now" lists DR stations where the artist is on the list, then Bauer stations (grey) with 14+ plays in the last 7 days. <b>New add</b> = the chance that the artist gets a song into rotation within the 8-week window: entering rotation (at or above the station's weekly play threshold) after at least 4 weeks out of rotation. For "any DR station", out of rotation everywhere first. An artist with a song in rotation now usually has to drop out before a new add, which is why current hits rank lower here. "In rotation now" shows where the artist is in rotation in the latest week; plays per week are for the window's first week. Click an artist for history and a what-if.</p>
|
||||
<p class="note">"In rotation now" lists DR stations where the artist is on the list, then Bauer stations (grey) with 14+ plays in the last 7 days. "Assume they release" shows the chance if the artist releases something in the window (release dates from their Deezer discography); "usual release rate" weighs that by how often they release. <b>New add</b> = the chance that the artist gets a song into rotation within the 8-week window: entering rotation (at or above the station's weekly play threshold) after at least 4 weeks out of rotation. For "any DR station", out of rotation everywhere first. An artist with a song in rotation now usually has to drop out before a new add, which is why current hits rank lower here. "In rotation now" shows where the artist is in rotation in the latest week; plays per week are for the window's first week. Click an artist for history and a what-if.</p>
|
||||
</section>
|
||||
|
||||
<section id="tab-model" hidden>
|
||||
@@ -185,9 +191,12 @@ const fmtDate = s => new Date(s + 'T00:00:00Z').toLocaleDateString('en-GB', { da
|
||||
|
||||
// Chance of a new add in the window (station group g, or any DR station).
|
||||
function chanP(r, g) {
|
||||
if (g === 'any') return r.add_any;
|
||||
if (g === 'p4') return Math.max(...P4S.map(c => r.add?.[c] ?? 0));
|
||||
return r.add?.[g];
|
||||
// "They release in the window" uses the conditional forecast where a discography is known.
|
||||
const rel = document.getElementById('mode')?.value === 'rel' && r.add_rel;
|
||||
const any = rel ? r.add_any_rel : r.add_any, per = rel ? r.add_rel : r.add;
|
||||
if (g === 'any') return any;
|
||||
if (g === 'p4') return Math.max(...P4S.map(c => per?.[c] ?? 0));
|
||||
return per?.[g];
|
||||
}
|
||||
function nowPlays(r, g) {
|
||||
const now = r.now || {};
|
||||
@@ -321,11 +330,12 @@ async function showArtist(id) {
|
||||
<button class="x" aria-label="Close" onclick="closeDrawer()">×</button>
|
||||
</div>
|
||||
<div class="sec">
|
||||
<h3>Chance of a new add in the 8 weeks from ${fc.window_start ? fmtDate(fc.window_start) : '—'}</h3>
|
||||
<h3>Chance of a new add in the 8 weeks from ${fc.window_start ? fmtDate(fc.window_start) : '—'}${$('mode').value === 'rel' && fc.add_rel ? ', if they release in it' : ''}</h3>
|
||||
<div class="kpis">
|
||||
<div class="kpi"><div>Any DR station</div><b>${pct(fc.add_any)}</b></div>
|
||||
${GROUPS.map(([g, l]) => `<div class="kpi"><div>${l}</div><b>${pct(chanP(fc, g))}</b></div>`).join('')}
|
||||
</div>
|
||||
${fc.p_release != null ? `<p class="note">Chance they release something in the window (from their release rate): <b>${pct(fc.p_release)}</b>. If they release: ${pct(fc.add_any_rel)} · at their usual rate: ${pct(fc.add_any)}.</p>` : '<p class="note">No discography found on Deezer for this artist, so release timing isn\'t in the forecast.</p>'}
|
||||
<p class="note">In rotation now: ${nowChips(a.now, Object.fromEntries(Object.entries(a.bauer || {}).map(([s, v]) => [s, v.plays])))} · plays in the week of ${fp.week ? fmtDate(fp.week) : '—'}: <b>${Math.round(fp.mean ?? 0)}</b> (${Math.round(fp.lo ?? 0)}–${Math.round(fp.hi ?? 0)})</p>
|
||||
</div>
|
||||
<div class="sec"><h3>Weekly plays, last 51 weeks and next 12</h3>${historyChart(a)}</div>
|
||||
@@ -341,11 +351,12 @@ function whatIfUI(a, h) {
|
||||
const box = $('wi');
|
||||
box.innerHTML = `<div class="wi">
|
||||
<div class="row"><label for="wi-h">Window starts in (weeks)</label><input type="range" id="wi-h" min="0" max="${meta.horizons.length}" value="${h}"><b id="wi-hv"></b></div>
|
||||
<div class="row"><label for="wi-r">Releases a song in the window</label><input type="checkbox" id="wi-r" checked><b></b></div>
|
||||
<div class="row"><label for="wi-e">New chart entry, weeks ago</label><input type="range" id="wi-e" min="-1" max="26" value="-1"><b id="wi-ev"></b></div>
|
||||
<div class="row"><label for="wi-t">Track Top-40 position now</label><input type="range" id="wi-t" min="0" max="40" value="0"><b id="wi-tv"></b></div>
|
||||
<div class="row"><label for="wi-a">Airplay Top-20 position now</label><input type="range" id="wi-a" min="0" max="20" value="0"><b id="wi-av"></b></div>
|
||||
<div id="wi-out"></div>
|
||||
<p class="note">Change the artist's chart situation (as if it were true this week) and see how the model's forecast moves. "New chart entry" stands in for a release that charted, until release dates are in the model.</p>
|
||||
<p class="note">Switch the release on or off and change the artist's chart situation (as if it were true this week) to see how the forecast moves.</p>
|
||||
</div>`;
|
||||
let init = false, timer = null;
|
||||
const label = () => {
|
||||
@@ -357,6 +368,7 @@ function whatIfUI(a, h) {
|
||||
const run = async () => {
|
||||
label();
|
||||
let qs = `id=${encodeURIComponent(a.id)}&h=${$('wi-h').value}`;
|
||||
qs += `&release=${$('wi-r').checked ? 'yes' : 'no'}`;
|
||||
if (init) qs += `&entry=${$('wi-e').value < 0 ? 'none' : $('wi-e').value}&t40=${$('wi-t').value}&air=${$('wi-a').value}`;
|
||||
const r = await fetch(BASE + '/api/whatif?' + qs);
|
||||
if (r.status === 503) { $('wi-out').innerHTML = '<p class="note">The model is still loading on the server; try again in a minute.</p>'; return; }
|
||||
@@ -375,7 +387,7 @@ function whatIfUI(a, h) {
|
||||
<div class="kpis">${rows.map(([l, b, s]) => `<div class="kpi"><div>${l}</div><b>${pct(s)}</b>${d(b, s, 'p')}<div>was ${pct(b)}</div></div>`).join('')}
|
||||
<div class="kpi"><div>Plays, first week</div><b>${Math.round(w.scenario.mean)}</b>${d(w.base.mean, w.scenario.mean, 'n')}<div>was ${Math.round(w.base.mean)}</div></div></div>`;
|
||||
};
|
||||
['wi-h', 'wi-e', 'wi-t', 'wi-a'].forEach(id => $(id).addEventListener('input', () => { label(); clearTimeout(timer); timer = setTimeout(run, 120); }));
|
||||
['wi-h', 'wi-r', 'wi-e', 'wi-t', 'wi-a'].forEach(id => $(id).addEventListener('input', () => { label(); clearTimeout(timer); timer = setTimeout(run, 120); }));
|
||||
run();
|
||||
}
|
||||
|
||||
@@ -402,7 +414,7 @@ document.querySelectorAll('nav button').forEach(b => b.addEventListener('click',
|
||||
$('tab-rank').hidden = b.dataset.tab !== 'rank'; $('tab-model').hidden = b.dataset.tab !== 'model';
|
||||
}));
|
||||
$('h').addEventListener('input', () => { shown = 100; loadRank(); });
|
||||
['ch', 'sort', 'dk'].forEach(id => $(id).addEventListener('change', () => { shown = 100; render(); }));
|
||||
['ch', 'sort', 'dk', 'mode'].forEach(id => $(id).addEventListener('change', () => { shown = 100; render(); }));
|
||||
$('q').addEventListener('input', () => { shown = 100; render(); });
|
||||
$('more').addEventListener('click', () => { shown += 100; render(); });
|
||||
$('rows').addEventListener('click', e => { const tr = e.target.closest('tr[data-id]'); if (tr) showArtist(tr.dataset.id); });
|
||||
|
||||
Reference in New Issue
Block a user