From f23fdd3ec595d299d3396b3a7d542d6be8fbac4c Mon Sep 17 00:00:00 2001 From: Valentin Berlier Date: Mon, 9 Oct 2023 19:29:27 +0200 Subject: [PATCH] fix: clean up pack.mcmeta when deleting overlays --- beet/library/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/beet/library/base.py b/beet/library/base.py index e31b8772..7facb3bb 100644 --- a/beet/library/base.py +++ b/beet/library/base.py @@ -810,6 +810,12 @@ def __delitem__(self, key: str): for i, entry in enumerate(entries): if entry.get("directory") == key: del entries[i] + if not entries: + del overlays["entries"] + if not overlays: + del self.pack.mcmeta.data["overlays"] + break + def missing(self, key: str) -> PackType: if self.pack is None: