Rows that skip the dedup
The second follow-up in q-nfx-048: some special rows don't need global dedup. Think of a row of shows the viewer is partway through. If a title is in it, it should stay in it, even if the trending row above has it too.
Say three choices out loud, because the report doesn't settle them:
- Does an exempt row check the screen? No, that is what exempt means.
- Does it still drop its own repeats? Yes. One row showing a title twice is wrong whatever the row is.
- Do its titles block the rows below? Here, no. The exempt row sits outside the dedup.
Choice 3 could go the other way, and an interviewer may ask why. A row that shows a title the viewer already sees in "continue watching" may still be fine below it, and one rule for exempt rows is simpler to explain.
With place_row, all three choices are one argument. Give an exempt row a fresh empty set:
out.append(place_row(row, width, set() if r in exempt else shown))
The empty set means nothing is on the screen as far as this row knows, so it checks nothing. place_row still adds the row's picks to that set as it goes, which drops the row's own repeats. And the page's shown never hears about it.
In the editor, place_row is given. Add exempt, a set of row indexes, to dedup_homepage(rows, width, exempt).