From ca4a9e559d48bda94311afd17918a92a27c69abd Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Mon, 9 Apr 2018 16:13:30 +0530 Subject: * lisp/emms-cache.el: Add the `emms-cache-reset' function for convenience It can be useful sometimes to reset the cache: - Whenever too many undesirable tracks have populated the collection, it's faster to reset and re-add only the desired tracks. - Whenever it gets corrupted (it ideally should not...). --- lisp/emms-cache.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lisp') diff --git a/lisp/emms-cache.el b/lisp/emms-cache.el index 4e45eda..792b1b8 100644 --- a/lisp/emms-cache.el +++ b/lisp/emms-cache.el @@ -179,5 +179,17 @@ been modified." (setq emms-cache-dirty t))) (message "Syncing emms track cache...done")) +(defun emms-cache-reset () + "Reset the cache." + (interactive) + (when (yes-or-no-p "Really reset the cache?") + (setq emms-cache-db + (make-hash-table + :test (if (fboundp 'define-hash-table-test) + 'string-hash + 'equal))) + (setq emms-cache-dirty t) + (emms-cache-save))) + (provide 'emms-cache) ;;; emms-cache.el ends here -- cgit v1.2.3