-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Adds a zero_disc_number_if_single_disc
to the zero plugin
#5909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Adds a `zero_disc_number_if_single_disc` boolean to the zero plugin for writing to files. Adds the logic that, if disctotal is set and there is only one disc in disctotal, that the disc is not set. This keeps tags cleaner, only using disc on multi-disc albums. The disctotal is not touched, particularly as this is not usually displayed in most clients. The field is kept only for writing the tags, but the disc number is maintained in the database.
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
Would love to hear some feedback on this or its implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the failing CI check - you need run poe format
to make sure the changes are formatted consistently.
@@ -123,8 +124,13 @@ def set_fields(self, item, tags): | |||
""" | |||
fields_set = False | |||
|
|||
if 'disc' in tags and self.config["zero_disc_number_if_single_disc"].get(bool): | |||
if getattr(item, 'disctotal', None) == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can access this attribute directly
if getattr(item, 'disctotal', None) == 1: | |
if item.disctotal == 1: |
@@ -123,8 +124,13 @@ def set_fields(self, item, tags): | |||
""" | |||
fields_set = False | |||
|
|||
if 'disc' in tags and self.config["zero_disc_number_if_single_disc"].get(bool): | |||
if getattr(item, 'disctotal', None) == 1: | |||
self._log.debug("{0}: {1} -> None", 'disc', item['disc']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._log.debug("{0}: {1} -> None", 'disc', item['disc']) | |
self._log.debug("disc: {.disc} -> None", item) |
Adds a
zero_disc_number_if_single_disc
boolean to the zero plugin for writing to files. Adds the logic that, if disctotal is set and there is only one disc in disctotal, that the disc is not set.This keeps tags cleaner, only using disc on multi-disc albums. The disctotal is not touched, particularly as this is not usually displayed in most clients.
The field is removed only for writing the tags, but the disc number is maintained in the database to avoid breaking anything that may depend on a disc number or avoid possible loops or failed logic.
A column of disc 1 makes me feel there should be a disc 2, when most albums are a single disc only.
Description
This addresses concerns such as https://beets-users.narkive.com/fxh0cgmC/beets-remove-disc-field-for-single-disc-albums and accomplishes things like #5670 but in tags instead of just in the path.
To Do