mirror of
https://github.com/beetbox/beets.git
synced 2026-01-01 13:33:02 +01:00
use a lambda for singleton field (#680)
Avoids a naming collision for now. We might revert this later with a decorator approach.
This commit is contained in:
parent
2ec140edbc
commit
91537bc3d1
1 changed files with 1 additions and 6 deletions
|
|
@ -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).
|
||||
|
|
|
|||
Loading…
Reference in a new issue