Fix Plex album completion false positives from leafCount reflecting partial ownership
This commit is contained in:
parent
5f94352b40
commit
7b933ff97a
1 changed files with 6 additions and 2 deletions
|
|
@ -3515,8 +3515,12 @@ class MusicDatabase:
|
|||
# count so edition differences don't make a complete album appear incomplete.
|
||||
# e.g. user has standard edition (12 tracks, all present) but Spotify returns
|
||||
# deluxe edition count (20) — should show as complete, not 12/20.
|
||||
if expected_track_count is not None and stored_track_count > 0 and owned_tracks >= stored_track_count:
|
||||
# Album is complete by its own metadata — don't inflate expected with a different edition's count
|
||||
if (expected_track_count is not None and stored_track_count > 0
|
||||
and owned_tracks >= stored_track_count
|
||||
and stored_track_count >= expected_track_count * 0.6):
|
||||
# Album is complete by its own metadata — don't inflate expected with a different edition's count.
|
||||
# Guard: stored count must be >=60% of expected to look like a plausible edition variant
|
||||
# (standard 12 vs deluxe 20 = 60%), not just Plex's leafCount reflecting partial ownership.
|
||||
expected_tracks = stored_track_count
|
||||
elif expected_track_count is not None:
|
||||
expected_tracks = expected_track_count
|
||||
|
|
|
|||
Loading…
Reference in a new issue