mpdstats: do not call item.write

The attributes used by this plugin are not 'writable'[^1] anyway so this
leads to needless file access. Also we do not need to check for
`item._lib` as this will always be populated by the call to
`lib.items(...)`.

[^1]: As per `ITEM_KEYS_WRITABLE` in `beets/library.py`
This commit is contained in:
Johann Klähn 2013-12-11 20:45:52 +01:00
parent 1066c79b56
commit ad2028ddf7

View file

@ -152,9 +152,7 @@ class Client(object):
item[attribute],
displayable_path(item.path),
))
item.write()
if item._lib:
item.store()
item.store()
def beets_update(self, item, attribute, value=None, increment=None):
""" Update the beets item. Set attribute to value or increment the
@ -174,9 +172,7 @@ class Client(object):
item[attribute],
displayable_path(item.path),
))
item.write()
if item._lib:
item.store()
item.store()
def mpd_func(self, func, **kwargs):
"""Wrapper for requests to the MPD server. Tries to re-connect if the