mirror of
https://github.com/beetbox/beets.git
synced 2025-12-29 12:02:44 +01:00
Merge pull request #2975 from zsinskri/2972-from-scratch-keep-immutable
from_scratch option: keep immutable fields (#2972)
This commit is contained in:
commit
5606717499
3 changed files with 19 additions and 1 deletions
|
|
@ -564,7 +564,7 @@ class Item(LibModel):
|
|||
|
||||
def clear(self):
|
||||
"""Set all key/value pairs to None."""
|
||||
for key in self._media_fields:
|
||||
for key in self._media_tag_fields:
|
||||
setattr(self, key, None)
|
||||
|
||||
def get_album(self):
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ Fixes:
|
|||
* Display the artist credit when matching albums if the :ref:`artist_credit`
|
||||
configuration option is set.
|
||||
:bug:`2953`
|
||||
* With the :ref:`from_scratch` configuration option set, only writable fields
|
||||
are cleared. Beets now no longer ignores the format your music is saved in.
|
||||
:bug:`2972`
|
||||
* LastGenre: Allow to set the configuration option ``prefer_specific``
|
||||
without setting ``canonical``.
|
||||
:bug:`2973`
|
||||
|
|
|
|||
|
|
@ -644,6 +644,21 @@ class ImportTest(_common.TestCase, ImportHelper):
|
|||
self.importer.run()
|
||||
self.assertEqual(self.lib.items().get().genre, u'')
|
||||
|
||||
def test_apply_from_scratch_keeps_format(self):
|
||||
config['import']['from_scratch'] = True
|
||||
|
||||
self.importer.add_choice(importer.action.APPLY)
|
||||
self.importer.run()
|
||||
self.assertEqual(self.lib.items().get().format, u'MP3')
|
||||
|
||||
def test_apply_from_scratch_keeps_bitrate(self):
|
||||
config['import']['from_scratch'] = True
|
||||
bitrate = 80000
|
||||
|
||||
self.importer.add_choice(importer.action.APPLY)
|
||||
self.importer.run()
|
||||
self.assertEqual(self.lib.items().get().bitrate, bitrate)
|
||||
|
||||
def test_apply_with_move_deletes_import(self):
|
||||
config['import']['move'] = True
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue