Commit 2fdc7fc
Deduplicate media items by dedupKey (#126)
* Deduplicate media items by dedupKey
There can be photos with different mediaKeys but same dedupKey, likely caused by saving shared albums.
We should not solve for them, since
- Google Photos natively collapses them into one in timeline/albums
- API doesn't allow to trash one of them without trashing others
So keep only the first item we see for each dedupKey.
* Fix totalItems/log to report raw item count, not post-dedup count
mediaItems was reassigned to the deduped set, so ScanTiming.totalItems
and the "[GPD] detectDuplicates" log line silently started meaning
"items after dedup" instead of "items scanned". Use a separate
dedupedItems binding for candidate filtering so totalItems keeps its
original meaning while duplicate detection still only runs on the
deduped set.
Claude-Session: https://claude.ai/code/session_01EwfkVcjRcCwgv9oMRhnMqu
* Rename dropDuplicateDedupKeys to dedupeByDedupKey; tidy test formatting
Claude-Session: https://claude.ai/code/session_01EwfkVcjRcCwgv9oMRhnMqu
---------
Co-authored-by: Mack Talcott <mack@tal.co.tt>1 parent 326ba1a commit 2fdc7fc
2 files changed
Lines changed: 66 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
32 | 54 | | |
33 | 55 | | |
34 | 56 | | |
| |||
160 | 182 | | |
161 | 183 | | |
162 | 184 | | |
| 185 | + | |
| 186 | + | |
163 | 187 | | |
164 | 188 | | |
165 | 189 | | |
166 | 190 | | |
167 | | - | |
| 191 | + | |
168 | 192 | | |
169 | 193 | | |
170 | 194 | | |
| |||
466 | 490 | | |
467 | 491 | | |
468 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
469 | 496 | | |
470 | 497 | | |
471 | 498 | | |
472 | | - | |
| 499 | + | |
473 | 500 | | |
474 | 501 | | |
475 | 502 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
0 commit comments