Skip to content

Commit

Permalink
fix: only use field_map for namespace repr
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Apr 26, 2022
1 parent f71130d commit 53f0a88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions beet/library/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,9 @@ def dump(self, namespace: str, origin: FileOrigin):

def __repr__(self) -> str:
args = ", ".join(
f"{self.field_map[key]}={value}" for key, value in self.items() if value
f"{self.field_map[key]}={value}"
for key, value in self.items()
if key in self.field_map and value
)
return f"{self.__class__.__name__}({args})"

Expand Down Expand Up @@ -821,7 +823,7 @@ def merge(
@property
def content(self) -> Iterator[Tuple[str, NamespaceFile]]:
"""Iterator that yields all the files stored in the pack."""
for file_type in self.namespace_type.field_map:
for file_type in self.resolve_scope_map().values():
yield from NamespaceProxy[NamespaceFile](self, file_type).items()

@overload
Expand Down

0 comments on commit 53f0a88

Please sign in to comment.