From 91537bc3d1158e8bf2a03893c9533efe59205ea8 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 12 Apr 2014 13:49:53 -0700 Subject: [PATCH] use a lambda for singleton field (#680) Avoids a naming collision for now. We might revert this later with a decorator approach. --- beets/library.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/beets/library.py b/beets/library.py index 155b8e917..44cf518d0 100644 --- a/beets/library.py +++ b/beets/library.py @@ -263,7 +263,7 @@ class Item(LibModel): @classmethod def _getters(cls): getters = plugins.item_field_getters() - getters['singleton'] = Item.singleton + getters['singleton'] = lambda i: i.album_id is None return getters @classmethod @@ -291,11 +291,6 @@ class Item(LibModel): super(Item, self).__setitem__(key, value) - def singleton(self): - """Returns a boolean indicating whether this item is a singleton - (doesn't belong to an album)""" - return self.album_id is None - def update(self, values): """Set all key/value pairs in the mapping. If mtime is specified, it is not reset (as it might otherwise be).