mirror of
https://github.com/beetbox/beets.git
synced 2026-01-02 14:03:12 +01:00
More verbose move message
This commit is contained in:
parent
d35a68d0d8
commit
a4100a28a5
1 changed files with 8 additions and 3 deletions
|
|
@ -1490,18 +1490,23 @@ def move_items(lib, dest, query, copy, album, pretend, confirm=False,
|
|||
"""
|
||||
items, albums = _do_query(lib, query, album, False)
|
||||
objs = albums if album else items
|
||||
num_objs = len(objs)
|
||||
|
||||
# Filter out files that don't need to be moved.
|
||||
isitemmoved = lambda item: item.path != item.destination(basedir=dest)
|
||||
isalbummoved = lambda album: any(isitemmoved(i) for i in album.items())
|
||||
objs = [o for o in objs if (isalbummoved if album else isitemmoved)(o)]
|
||||
|
||||
num_unmoved = num_objs - len(objs)
|
||||
unmoved_msg = u''
|
||||
if num_unmoved > 0:
|
||||
unmoved_msg = u' ({} already in place)'.format(num_unmoved)
|
||||
|
||||
copy = copy or export # Exporting always copies.
|
||||
action = u'Copying' if copy else u'Moving'
|
||||
act = u'copy' if copy else u'move'
|
||||
entity = u'album' if album else u'item'
|
||||
log.info(u'{0} {1} {2}{3}.', action, len(objs), entity,
|
||||
u's' if len(objs) != 1 else u'')
|
||||
log.info(u'{0} {1} {2}{3}{4}.', action, len(objs), entity,
|
||||
u's' if len(objs) != 1 else u'', unmoved_msg)
|
||||
if not objs:
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue