From 31d56d4a59054f4e32a99561fd41abc1d3516eed Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sun, 2 Apr 2023 16:53:04 +0200 Subject: [PATCH] Database: Disable delete hotkey unless audio file is selected Fixes behavior where Rockbox would offer to delete nonexistent directories. Change-Id: I219da382b181372023b9408ac9a85189bffdcb74 --- apps/onplay.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/onplay.c b/apps/onplay.c index 96c2ddd4e3..4ef79fc220 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -1890,6 +1890,13 @@ static bool hotkey_delete_item(void) if (selected_file_attr & ATTR_VOLUME) return false; #endif + +#ifdef HAVE_TAGCACHE + if (context == CONTEXT_ID3DB && + (selected_file_attr & FILE_ATTR_MASK) != FILE_ATTR_AUDIO) + return false; +#endif + return delete_file_dir(); }