From 58dd5f47f5dded4220fe3cf43dd2b6f364d9a977 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 22 Feb 2014 14:37:04 -0800 Subject: [PATCH] use _show_model_changes in mbsync --- beetsplug/mbsync.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/beetsplug/mbsync.py b/beetsplug/mbsync.py index dc566ab9e..d2182e825 100644 --- a/beetsplug/mbsync.py +++ b/beetsplug/mbsync.py @@ -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.