On December 12, 2023 11:07:11 AM PST, Morgan Smith <Morgan.J.Smith@outlook.com> wrote:
Check to see if the file is in `emms-player-mpd-music-directory'.
emms-player-mpd.el | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/emms-player-mpd.el b/emms-player-mpd.el
index d1d6257..2666744 100644
--- a/emms-player-mpd.el
+++ b/emms-player-mpd.el
@@ -892,11 +892,14 @@ Execute CALLBACK with CLOSURE as its first argument when done."
"Return non-nil when we can play this track."
(and (memq (emms-track-type track) '(file url playlist streamlist))
(string-match (emms-player-get emms-player-mpd 'regex)
- (emms-track-name track))
- (condition-case nil
- (progn (emms-player-mpd-ensure-process)
- t)
- (error nil))))
+ (emms-track-name track))
+ (if emms-player-mpd-music-directory
+ (file-in-directory-p (emms-track-get track 'name)
+ emms-player-mpd-music-directory)
+ t)
+ (ignore-errors
+ (emms-player-mpd-ensure-process)
+ t)))
(defun emms-player-mpd-play (&optional id)
"Play whatever is in the current MusicPD playlist.