From ea03c7fac2199158b21cdcbc9013ba01afc7b9b6 Mon Sep 17 00:00:00 2001 From: Rahul Ahuja Date: Thu, 3 Oct 2019 22:16:32 -0700 Subject: [PATCH] Better readability --- beets/library.py | 15 ++++++++------- beetsplug/bpsync.py | 3 +-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/beets/library.py b/beets/library.py index 239d96e81..d38d3ebb5 100644 --- a/beets/library.py +++ b/beets/library.py @@ -1651,14 +1651,15 @@ class DefaultTemplateFunctions(object): def apply_item_changes(lib, item, move, pretend, write): """Store, move and write the item according to the arguments. """ - if not pretend: - # Move the item if it's in the library. - if move and lib.directory in util.ancestry(item.path): - item.move(with_album=False) + if pretend: + return + # Move the item if it's in the library. + if move and lib.directory in util.ancestry(item.path): + item.move(with_album=False) - if write: - item.try_write() - item.store() + if write: + item.try_write() + item.store() # Get the name of tmpl_* functions in the above class. DefaultTemplateFunctions._func_names = \ diff --git a/beetsplug/bpsync.py b/beetsplug/bpsync.py index a69c9c3d7..479698faf 100644 --- a/beetsplug/bpsync.py +++ b/beetsplug/bpsync.py @@ -176,8 +176,7 @@ class BPSyncPlugin(BeetsPlugin): lib, item, move, pretend, write ) - if not changed or pretend: - # No change to any item. + if pretend or not changed: continue # Update album structure to reflect an item in it.