From 2f6d346aa5f5eae6f193e7e1554efd46df460602 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/beet/library/base.py b/beet/library/base.py index e31b8772..afdfc5a6 100644 --- a/beet/library/base.py +++ b/beet/library/base.py @@ -810,6 +810,11 @@ 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: