Avoid writing unknown track and disc totals#6655
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6655 +/- ##
=======================================
Coverage 72.44% 72.45%
=======================================
Files 160 160
Lines 20690 20694 +4
Branches 3272 3274 +2
=======================================
+ Hits 14989 14993 +4
Misses 4976 4976
Partials 725 725
🚀 New features to boost your workflow:
|
|
hey @Tsuizxgo! thank you for your contribution :)
Do you know if this always happens or is it a bug in metadata source(s) ? |
Thanks for checking! It does not necessarily mean that the metadata source explicitly returns
|
|
Your change sets those tags back to None if they are However this fix is at the last stage: when we write tags. If my understanding is correct things like
I think that's our core issue here. If we fixed this default value we wouldn't need special handling for these fields, and everything should report None/empty, including the tags. Wdyt? Would you have time to look into that? |
Description
Fixes #6194.
This PR fixes a small metadata-writing bug in beets.
When
tracktotalordisctotalis unknown, beets may store it internally as0. Before this change, that0was written directly into the audio file tags, so some files could end up with metadata liketrack 1/0ordisc 2/0.This change treats
0totals as unknown when writing tags to media files. The actualtrackanddiscnumbers are still written, but the unknown total fields are omitted instead of being written as0.I also added a regression test to make sure this behavior does not come back later.
To Do
Documentation.This is a bug fix in existing behavior and does not add or change any user-facing command or config option.docs/changelog.rst.