Remove ITEM_KEYS_WRITABLE

This commit is contained in:
Thomas Scholtes 2014-04-03 23:40:07 +02:00
parent 3c7dd13b72
commit 4b1a1e3d65
3 changed files with 4 additions and 3 deletions

View file

@ -185,7 +185,6 @@ ITEM_FIELDS = [
('added', DateType()),
]
ITEM_KEYS = [f[0] for f in ITEM_FIELDS]
ITEM_KEYS_WRITABLE = set(MediaFile.fields()).intersection(ITEM_KEYS)
# Database fields for the "albums" table.

View file

@ -1250,7 +1250,7 @@ def write_items(lib, query, pretend):
# Check for and display changes.
changed = ui.show_model_changes(item, clean_item,
library.ITEM_KEYS_WRITABLE,
MediaFile.fields(),
always=True)
if changed and not pretend:
try:

View file

@ -30,8 +30,9 @@ from beets.plugins import BeetsPlugin
import beets.ui
from beets import vfs
from beets.util import bluelet
from beets.library import ITEM_KEYS_WRITABLE
from beets.library import ITEM_KEYS
from beets import dbcore
from beets.mediafile import MediaFile
PROTOCOL_VERSION = '0.13.0'
BUFSIZE = 1024
@ -67,6 +68,7 @@ SAFE_COMMANDS = (
u'close', u'commands', u'notcommands', u'password', u'ping',
)
ITEM_KEYS_WRITABLE = set(MediaFile.fields()).intersection(ITEM_KEYS)
# Loggers.
log = logging.getLogger('beets.bpd')