From db72139490033a3bb97659f3ad1acd402bcfed99 Mon Sep 17 00:00:00 2001
From: SuperBFG7 <daniel@despite.ch>
Date: Fri, 11 May 2018 21:10:22 +0200
Subject: [PATCH] make A-Z filters work also on songs and playlists

---
 htdocs/js/mpd.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js
index 84a083b..913c0d9 100644
--- a/htdocs/js/mpd.js
+++ b/htdocs/js/mpd.js
@@ -1083,9 +1083,11 @@ function set_filter (c) {
     	$('#salamisandwich > tbody > tr.song').addClass('hide');
     	$('#salamisandwich > tbody > tr.plist').removeClass('hide');
     } else {
-    	$('#salamisandwich > tbody > tr.plist').addClass('hide');
-		$.each($('#salamisandwich > tbody > tr.dir'), function(i, line) {
+		$.each($('#salamisandwich > tbody > tr'), function(i, line) {
 			var first = basename($(line).attr('uri'))[0];
+			if ( $(line).hasClass('song') ) {
+				first = $(line).children().eq(1).text()[0];
+			}
 
 			if (filter === "num") {
 				if (!isNaN(first)) {
-- 
2.20.1