fix(merge): keep earliest created_at when merging scenes (no false NEW)
The NEW badge keys off scene.created_at. merge_scenes kept the survivor's created_at, but the dedup caller may pick the freshly re-ingested mirror as keep_id — so deduplicated old content got a recent created_at and showed up as NEW (report f17799b3). Coalesce to min(keep, drop) so a merged scene keeps its first-seen date. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
449b7e30d3
commit
811ea3232d
1 changed files with 6 additions and 0 deletions
|
|
@ -221,6 +221,12 @@ def _coalesce_canonical_fields(keep: Scene, drop: Scene) -> None:
|
|||
if drop.title and len(drop.title) > len(keep.title or ""):
|
||||
keep.title = drop.title
|
||||
keep.title_normalized = drop.title_normalized
|
||||
# created_at = najwcześniejsze "first seen" obu scen. NEW badge (apka) bazuje na
|
||||
# created_at; gdy dedup wybierze świeży re-ingest/mirror jako `keep`, stara treść
|
||||
# dostawałaby fałszywe NEW po merdżu (report f17799b3). Bierzemy min → zdeduplikowana
|
||||
# scena zachowuje datę pierwszego pojawienia, nie datę re-ingestu.
|
||||
if drop.created_at and keep.created_at and drop.created_at < keep.created_at:
|
||||
keep.created_at = drop.created_at
|
||||
|
||||
|
||||
def _close_pending_candidates(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue