mirror of
https://github.com/beetbox/beets.git
synced 2025-12-08 17:49:11 +01:00
implemented interactive selection in modify
This commit is contained in:
parent
6b39751337
commit
c28eaee7d0
2 changed files with 19 additions and 2 deletions
|
|
@ -1349,8 +1349,9 @@ def modify_items(lib, mods, dels, query, write, move, album, confirm):
|
|||
else:
|
||||
extra = ''
|
||||
|
||||
if not ui.input_yn('Really modify%s (Y/n)?' % extra):
|
||||
return
|
||||
changed = ui.input_select_items(
|
||||
'Really modify%s (Y/n)?' % extra, changed,
|
||||
lambda o: print_modify_item(o, mods, dels))
|
||||
|
||||
# Apply changes to database and files
|
||||
with lib.transaction():
|
||||
|
|
|
|||
|
|
@ -231,6 +231,22 @@ class ModifyTest(unittest.TestCase, TestHelper):
|
|||
item.load()
|
||||
self.assertEqual(0, item.mtime)
|
||||
|
||||
def test_selective_modify(self):
|
||||
title = "Tracktitle"
|
||||
album = "album"
|
||||
origArtist = "composer"
|
||||
newArtist = "coverArtist"
|
||||
for i in range(0, 10):
|
||||
self.add_item_fixture(title="{0}{1}".format(title, i),
|
||||
artist=origArtist,
|
||||
album=album)
|
||||
self.modify_inp('s\ny\ny\ny\nn\nn\ny\ny\ny\ny\nn',
|
||||
title, "artist={0}".format(newArtist))
|
||||
origItems = self.lib.items("artist:{0}".format(origArtist))
|
||||
newItems = self.lib.items("artist:{0}".format(newArtist))
|
||||
self.assertEqual(len(list(origItems)), 3)
|
||||
self.assertEqual(len(list(newItems)), 7)
|
||||
|
||||
# Album Tests
|
||||
|
||||
def test_modify_album(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue