Video Discover: fix orphaned Top 10 numerals when hiding owned + lift 'New' up the page
Bug: with 'Hide owned' on, an owned title in the Top 10 (e.g. House of the Dragon) had its card hidden by the global .vdsc-hide-owned rule while its big rank numeral stayed — a blank gap with just a number. The ranked rail fetched the true chart (ignoring hide_owned) precisely to keep the chart intact, which collided with that CSS. Fix: ranked rail now honours hide_owned at fetch time (owned dropped server-side, ranks stay contiguous 1-N), plus a CSS safety net exempting ranked cards from the hide rule so a numeral can never be stranded. When hide-owned is OFF the true chart still shows owned with the 'In Library' ribbon. Ordering: moved 'New & noteworthy' above the async collection/taste groups so the two always-visible discovery rows (Top 10 + New) anchor the top of the page, matching how streaming services surface new releases.
This commit is contained in:
parent
24b79dc29e
commit
e7552d3c62
2 changed files with 12 additions and 3 deletions
|
|
@ -156,9 +156,9 @@
|
|||
return [
|
||||
{ id: 'foryou', label: 'For you', rails: foryou },
|
||||
{ id: 'topten', label: 'Top 10 today', rails: [TOP10] },
|
||||
{ id: 'new', label: 'New & noteworthy', rails: NEW_RAILS },
|
||||
{ id: 'collection', label: 'Finish your collection', rails: [] },
|
||||
{ id: 'taste', label: 'More of what you like', rails: taste },
|
||||
{ id: 'new', label: 'New & noteworthy', rails: NEW_RAILS },
|
||||
{ id: 'popular', label: 'Trending & popular', rails: CURATED },
|
||||
{ id: 'mood', label: 'By mood', rails: MOOD_RAILS },
|
||||
{ id: 'studios', label: 'From the studios', rails: STUDIO_RAILS },
|
||||
|
|
@ -633,10 +633,15 @@
|
|||
var rail = $('[data-vdsc-rail]', shelf);
|
||||
var grp = shelf.closest('.vdsc-group');
|
||||
var ranked = shelf.getAttribute('data-vdsc-ranked') === '1';
|
||||
var hideOwned = isHideOwned();
|
||||
// Normal: 2 pages (~40 items). Hiding owned: let the backend page DEEPER and drop
|
||||
// owned server-side, so a huge library's rail still fills instead of CSS-hiding to ~nothing.
|
||||
// Ranked (Top 10): a single fixed chart — never paged, capped at 10.
|
||||
var q = shelf.getAttribute('data-vdsc-q') + (ranked ? '' : (isHideOwned() ? '&hide_owned=1' : '&pages=2'));
|
||||
// Ranked (Top 10): a single fixed chart — never paged, capped at 10. It must ALSO honour
|
||||
// hide-owned at fetch time: the global `.vdsc-hide-owned .vsr-card--owned{display:none}`
|
||||
// rule would otherwise hide an owned card while its rank numeral stayed, leaving a gap.
|
||||
var q = shelf.getAttribute('data-vdsc-q') +
|
||||
(ranked ? (hideOwned ? '&hide_owned=1' : '')
|
||||
: (hideOwned ? '&hide_owned=1' : '&pages=2'));
|
||||
cachedFetch(LIST_URL + '?' + q)
|
||||
.then(function (d) {
|
||||
var items = (d && d.items) || [];
|
||||
|
|
|
|||
|
|
@ -2405,6 +2405,10 @@ body[data-side="video"] #soulsync-toggle { display: none; }
|
|||
font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.7); cursor: pointer; user-select: none; }
|
||||
.vdsc-toggle input { accent-color: rgb(var(--accent-rgb, 88 101 242)); width: 16px; height: 16px; cursor: pointer; }
|
||||
.vdsc-hide-owned .vsr-card--owned { display: none; }
|
||||
/* …except in the ranked Top 10 — hiding an owned card there would strand its big
|
||||
rank numeral as a gap. The rail also drops owned server-side, so this only matters
|
||||
if one ever slips through: show it (with its 'In Library' ribbon) instead. */
|
||||
.vdsc-hide-owned .vdsc-shelf--ranked .vsr-card--owned { display: flex; }
|
||||
|
||||
/* rail-language preference chips — which original languages show in the general rails */
|
||||
.vdsc-langs { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: 14px; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue