mirror of
https://github.com/beetbox/beets.git
synced 2026-01-30 12:02:41 +01:00
use _show_model_changes in mbsync
This commit is contained in:
parent
ace34a8654
commit
58dd5f47f5
1 changed files with 3 additions and 11 deletions
|
|
@ -1,5 +1,5 @@
|
|||
# This file is part of beets.
|
||||
# Copyright 2013, Jakob Schnitzer.
|
||||
# Copyright 2014, Jakob Schnitzer.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
|
|
@ -28,18 +28,10 @@ def _print_and_apply_changes(lib, item, old_data, move, pretend, write):
|
|||
"""Apply changes to an Item and preview them in the console. Return
|
||||
a boolean indicating whether any changes were made.
|
||||
"""
|
||||
changes = {}
|
||||
for key in library.ITEM_KEYS_META:
|
||||
if key in item._dirty:
|
||||
changes[key] = old_data[key], getattr(item, key)
|
||||
if not changes:
|
||||
changed = ui.commands._show_model_changes(item)
|
||||
if not changed:
|
||||
return False
|
||||
|
||||
# Something changed.
|
||||
ui.print_obj(item, lib)
|
||||
for key, (oldval, newval) in changes.iteritems():
|
||||
ui.commands._showdiff(key, oldval, newval)
|
||||
|
||||
# If we're just pretending, then don't move or save.
|
||||
if not pretend:
|
||||
# Move the item if it's in the library.
|
||||
|
|
|
|||
Loading…
Reference in a new issue