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 75.63% 75.65% +0.02%
==========================================
Files 162 162
Lines 20820 20833 +13
Branches 3298 3299 +1
==========================================
+ Hits 15747 15762 +15
+ Misses 4292 4291 -1
+ Partials 781 780 -1
🚀 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? |
|
Hi @ShimmerGlass, sorry for the ping. I updated the PR to address the field-type-level approach you suggested. I also added coverage for the new type behavior, formatted output, When you have time, could you please take another look? Thanks! |
|
Hi @semohr, sorry for another ping, specifically on #6655. I just merged the latest This PR is part of my course open-source contribution assignment, and the bonus deadline is today, so I am a bit anxious about the timing. I completely understand that maintainers are busy and that merge decisions should follow the project’s normal review process. If you happen to have time to take another look today, I would really appreciate it. Thank you! |
Description
Fixes #6194.
This PR fixes how beets represents unknown
tracktotalanddisctotalvalues.When
tracktotalordisctotalis unknown, beets may store it internally as0. Previously that value could surface as00in library/template output and could be written into audio file tags, producing metadata liketrack 1/0ordisc 2/0.This change treats
0totals as unknown at the field type level fortracktotalanddisctotal. Those fields now normalize0toNone, format as empty in library output such asbeet info --library, and naturally omit/clear the corresponding media tags when writing files.The actual
trackanddiscnumbers are still written and formatted normally.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.beet info --library, field normalization, and file writing.