diff --git a/site-lisp/db-music.el b/site-lisp/db-music.el index 52379f1..d87a880 100644 --- a/site-lisp/db-music.el +++ b/site-lisp/db-music.el @@ -41,29 +41,26 @@ exist anymore are removed from it." (puthash (car track) (cdr track) playlist-hash))) (let (new-playlist) - ;; iterate over files in DIRECTORY and add them to the playlist, with the + ;; Iterate over files in DIRECTORY and add them to the playlist, with the ;; already known state whenever possible (dolist (file (directory-files-recursively directory "")) (message "Checking %s" file) - (push (if-let ((state (gethash file playlist-hash nil))) - (cons file state) - (cons file :undecided)) + (push (cons file (gethash file playlist-hash :undecided)) new-playlist) (remhash file playlist-hash)) - ;; keep all other tracks that are not in DIRECTORY + ;; Keep all other tracks that are not in DIRECTORY (maphash #'(lambda (track state) (push (cons track state) new-playlist)) playlist-hash) - ;; sort to keep version control happy + ;; Sort to keep version control happy (setq new-playlist (sort new-playlist #'(lambda (track-1 track-2) - (string< (car track-1) - (car track-2))))) + (string< (car track-1) (car track-2))))) - ;; save it + ;; Save and exit (customize-save-variable 'db/playlist new-playlist)))) (provide 'db-music)