remove playlist command, instead use playlistinfo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
diff --git a/lib/mpd_client.rb b/lib/mpd_client.rb
index b38076e..cb16f94 100644
--- a/lib/mpd_client.rb
+++ b/lib/mpd_client.rb
@@ -53,7 +53,6 @@ module MPD
'deleteid' => 'fetch_nothing',
'move' => 'fetch_nothing',
'moveid' => 'fetch_nothing',
- 'playlist' => 'fetch_playlist',
'playlistfind' => 'fetch_songs',
'playlistid' => 'fetch_songs',
'playlistinfo' => 'fetch_songs',
@@ -321,22 +320,22 @@ module MPD
line
end
- def read_pair(separator)
+ def read_pair
line = read_line
return if line.nil?
- line.split(separator, 2)
+ line.split(': ', 2)
end
- def read_pairs(separator = ': ')
+ def read_pairs
result = []
- pair = read_pair(separator)
+ pair = read_pair
while pair
result << pair
- pair = read_pair(separator)
+ pair = read_pair
end
result
@@ -475,17 +474,6 @@ module MPD
fetch_objects(['playlist'])
end
- def fetch_playlist
- result = []
-
- read_pairs(':').each do |_key, value|
- value = value.chomp.force_encoding('utf-8')
- result << value
- end
-
- result
- end
-
def fetch_stickers
result = []