mirror of
https://github.com/beetbox/beets.git
synced 2026-02-08 08:25:23 +01:00
Merge 4165213838 into cdfb813910
This commit is contained in:
commit
4798eaa941
2 changed files with 12 additions and 4 deletions
|
|
@ -124,11 +124,15 @@ class ZeroPlugin(BeetsPlugin):
|
|||
"""
|
||||
fields_set = False
|
||||
|
||||
if "disc" in tags and self.config["omit_single_disc"].get(bool):
|
||||
if item.disctotal == 1:
|
||||
if self.config["omit_single_disc"].get(bool) and item.disctotal == 1:
|
||||
if "disc" in tags:
|
||||
fields_set = True
|
||||
self._log.debug("disc: {.disc} -> None", item)
|
||||
tags["disc"] = None
|
||||
if "disctotal" in tags:
|
||||
fields_set = True
|
||||
self._log.debug("disctotal: {.disctotal} -> None", item)
|
||||
tags["disctotal"] = None
|
||||
|
||||
if not self.fields_to_progs:
|
||||
self._log.warning("no fields list to remove")
|
||||
|
|
|
|||
|
|
@ -261,7 +261,8 @@ class ZeroPluginTest(PluginTestCase):
|
|||
|
||||
mf = MediaFile(syspath(item.path))
|
||||
assert mf.comments is None
|
||||
assert mf.disc == 0
|
||||
assert mf.disc is None
|
||||
assert mf.disctotal is None
|
||||
|
||||
def test_omit_single_disc_with_tags_multi(self):
|
||||
item = self.add_item_fixture(
|
||||
|
|
@ -276,6 +277,7 @@ class ZeroPluginTest(PluginTestCase):
|
|||
mf = MediaFile(syspath(item.path))
|
||||
assert mf.comments is None
|
||||
assert mf.disc == 1
|
||||
assert mf.disctotal == 4
|
||||
|
||||
def test_omit_single_disc_only_change_single(self):
|
||||
item = self.add_item_fixture(disctotal=1, disc=1)
|
||||
|
|
@ -285,7 +287,8 @@ class ZeroPluginTest(PluginTestCase):
|
|||
item.write()
|
||||
|
||||
mf = MediaFile(syspath(item.path))
|
||||
assert mf.disc == 0
|
||||
assert mf.disc is None
|
||||
assert mf.disctotal is None
|
||||
|
||||
def test_omit_single_disc_only_change_multi(self):
|
||||
item = self.add_item_fixture(disctotal=4, disc=1)
|
||||
|
|
@ -296,6 +299,7 @@ class ZeroPluginTest(PluginTestCase):
|
|||
|
||||
mf = MediaFile(syspath(item.path))
|
||||
assert mf.disc == 1
|
||||
assert mf.disctotal == 4
|
||||
|
||||
def test_empty_query_n_response_no_changes(self):
|
||||
item = self.add_item_fixture(
|
||||
|
|
|
|||
Loading…
Reference in a new issue