Remove tests. Update docs. Remove unnecessary return

Remove tests.  Update docs.  Remove unnecessary return.
This commit is contained in:
Michael Krieger 2025-09-16 11:55:34 -04:00 committed by Šarūnas Nejus
parent b1c87cd98c
commit dc13308784
3 changed files with 3 additions and 51 deletions

View file

@ -132,7 +132,6 @@ class ZeroPlugin(BeetsPlugin):
if not self.fields_to_progs: if not self.fields_to_progs:
self._log.warning("no fields list to remove") self._log.warning("no fields list to remove")
return fields_set
for field, progs in self.fields_to_progs.items(): for field, progs in self.fields_to_progs.items():
if field in tags: if field in tags:

View file

@ -31,8 +31,9 @@ to nullify and the conditions for nullifying them:
``keep_fields``---not both! ``keep_fields``---not both!
- To conditionally filter a field, use ``field: [regexp, regexp]`` to specify - To conditionally filter a field, use ``field: [regexp, regexp]`` to specify
regular expressions. regular expressions.
- Set ``omit_single_disc`` to ``True`` to zero the disc number field only if the - Set ``omit_single_disc`` to ``True`` to omit writing the ``disc`` number for
album contains a disctotal count and is a single disc. albums with only a single disc (``disctotal == 1``). By default, beets will
number the disc even if the album contains only one disc in total.
- By default this plugin only affects files' tags; the beets database is left - By default this plugin only affects files' tags; the beets database is left
unchanged. To update the tags in the database, set the ``update_database`` unchanged. To update the tags in the database, set the ``update_database``
option to true. option to true.

View file

@ -249,54 +249,6 @@ class ZeroPluginTest(PluginTestCase):
assert "id" not in z.fields_to_progs assert "id" not in z.fields_to_progs
def test_omit_single_disc_with_tags_single(self):
item = self.add_item_fixture(
disctotal=1, disc=1, comments="test comment"
)
item.write()
with self.configure_plugin(
{"omit_single_disc": True, "fields": ["comments"]}
):
item.write()
mf = MediaFile(syspath(item.path))
assert mf.comments is None
assert mf.disc == 0
def test_omit_single_disc_with_tags_multi(self):
item = self.add_item_fixture(
disctotal=4, disc=1, comments="test comment"
)
item.write()
with self.configure_plugin(
{"omit_single_disc": True, "fields": ["comments"]}
):
item.write()
mf = MediaFile(syspath(item.path))
assert mf.comments is None
assert mf.disc == 1
def test_omit_single_disc_only_change_single(self):
item = self.add_item_fixture(disctotal=1, disc=1)
item.write()
with self.configure_plugin({"omit_single_disc": True}):
item.write()
mf = MediaFile(syspath(item.path))
assert mf.disc == 0
def test_omit_single_disc_only_change_multi(self):
item = self.add_item_fixture(disctotal=4, disc=1)
item.write()
with self.configure_plugin({"omit_single_disc": True}):
item.write()
mf = MediaFile(syspath(item.path))
assert mf.disc == 1
def test_empty_query_n_response_no_changes(self): def test_empty_query_n_response_no_changes(self):
item = self.add_item_fixture( item = self.add_item_fixture(
year=2016, day=13, month=3, comments="test comment" year=2016, day=13, month=3, comments="test comment"