mirror of
https://github.com/beetbox/beets.git
synced 2025-12-25 10:05:13 +01:00
Avoid overeager inclusion of album attributes
Co-Authored-By: Curtis Rueden <ctrueden@wisc.edu>
This commit is contained in:
parent
701cd6c42b
commit
2d024d2f38
2 changed files with 5 additions and 3 deletions
|
|
@ -56,10 +56,11 @@ class FormattedMapping(Mapping):
|
|||
are replaced.
|
||||
"""
|
||||
|
||||
def __init__(self, model, for_path=False):
|
||||
def __init__(self, model, for_path=False, compute_keys=True):
|
||||
self.for_path = for_path
|
||||
self.model = model
|
||||
self.model_keys = model.keys(True)
|
||||
if compute_keys:
|
||||
self.model_keys = model.keys(True)
|
||||
|
||||
def __getitem__(self, key):
|
||||
if key in self.model_keys:
|
||||
|
|
|
|||
|
|
@ -375,9 +375,10 @@ class FormattedItemMapping(dbcore.db.FormattedMapping):
|
|||
"""
|
||||
|
||||
def __init__(self, item, for_path=False):
|
||||
super(FormattedItemMapping, self).__init__(item, for_path)
|
||||
# We treat album and item keys specially here,
|
||||
# so exclude transitive album keys from the model's keys.
|
||||
super(FormattedItemMapping, self).__init__(item, for_path,
|
||||
compute_keys=False)
|
||||
self.model_keys = item.keys(computed=True, with_album=False)
|
||||
self.item = item
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue