mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 04:55:10 +01:00
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:
parent
1066c79b56
commit
ad2028ddf7
1 changed files with 2 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue