Skip to content

Commit

Permalink
feat: support overlays (#434)
Browse files Browse the repository at this point in the history
* feat: support overlays

* chore: better merging

* feat: bump 1.20 pack format
  • Loading branch information
vberlier committed Oct 7, 2023
1 parent 4b0170b commit 951764f
Show file tree
Hide file tree
Showing 234 changed files with 708 additions and 266 deletions.
2 changes: 2 additions & 0 deletions beet/core/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def merge(self, other: Any) -> bool:
class MergeMixin:
def merge(self, other: Mapping[Any, SupportsMerge]) -> bool:
"""Merge values from the given dict-like object."""
if self is other:
return True
for key, value in other.items():
try:
if key not in self or not self[key].merge(value): # type: ignore
Expand Down
3 changes: 3 additions & 0 deletions beet/core/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
__all__ = [
"JsonDict",
"FileSystemPath",
"TextComponent",
"SupportedFormats",
"Sentinel",
"SENTINEL_OBJ",
"dump_json",
Expand Down Expand Up @@ -68,6 +70,7 @@ def __fspath__(self) -> str:
JsonDict = Dict[str, Any]
FileSystemPath = Union[str, PathLikeFallback]
TextComponent = Union[str, List[Any], JsonDict]
SupportedFormats = Union[int, List[int], JsonDict]


class Sentinel:
Expand Down

0 comments on commit 951764f

Please sign in to comment.