mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 19:42:42 +01:00
Made sure that the destination directory will exist
This commit is contained in:
parent
f5b23fffd4
commit
0dc948d9d3
2 changed files with 9 additions and 2 deletions
|
|
@ -1481,13 +1481,18 @@ def move_items(lib, dest, query, copy, album, pretend, export=False,
|
|||
for obj in objs])
|
||||
else:
|
||||
if export:
|
||||
|
||||
if album:
|
||||
for obj in objs:
|
||||
for item in obj.items():
|
||||
# Create necessary ancestry for the copy.
|
||||
util.mkdirall(item.destination(basedir=dest))
|
||||
util.copy(item.path, item.destination(basedir=dest))
|
||||
else:
|
||||
for item in objs:
|
||||
util.copy(item.path, item.destination(basedir=dest))
|
||||
for obj in objs:
|
||||
# Create necessary ancestry for the copy.
|
||||
util.mkdirall(obj.destination(basedir=dest))
|
||||
util.copy(obj.path, obj.destination(basedir=dest))
|
||||
if confirm:
|
||||
objs = ui.input_select_objects(
|
||||
u'Really %s' % act, objs,
|
||||
|
|
|
|||
|
|
@ -543,6 +543,8 @@ class ExportTest(_common.TestCase):
|
|||
self.assertExists(self.i.path)
|
||||
self.assertExists(self.itempath)
|
||||
|
||||
|
||||
|
||||
def test_pretend_move_item(self):
|
||||
self._move(dest=self.otherdir, pretend=True)
|
||||
self.i.load()
|
||||
|
|
|
|||
Loading…
Reference in a new issue