ruby-mpd 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ruby-mpd/parser.rb +5 -4
- data/lib/ruby-mpd/plugins/database.rb +1 -2
- data/lib/ruby-mpd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea50c78be2957c3c8baa9a4f5dfb7fde0f789c16
|
4
|
+
data.tar.gz: 4f42a33ba182a33ebfeeeb1b969c03510051fb38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 394b4830f32257749942a3a01faf8b41a2ef69dd3292430883956f34ff39d4f1298c78262c1039f7a45c5dc941a0d7ffbb8ab9780af37dfedd06fb63aebb5e4d
|
7
|
+
data.tar.gz: 02c228eec5ab7e2d1ce4014c761a1e3fdeca8ae12051f4457d68e9c7d777dc4ee6abf2993f1c8b4fa9e27ff3a105426ef3a7bb76aae0fa2562abc16e1b9260c8
|
data/lib/ruby-mpd/parser.rb
CHANGED
@@ -46,7 +46,7 @@ class MPD
|
|
46
46
|
|
47
47
|
|
48
48
|
# Commands, where it makes sense to always explicitly return an array.
|
49
|
-
RETURN_ARRAY = [:channels, :outputs, :readmessages, :list,
|
49
|
+
RETURN_ARRAY = [:channels, :outputs, :readmessages, :list,
|
50
50
|
:listallinfo, :find, :search, :listplaylists, :listplaylist, :playlistfind,
|
51
51
|
:playlistsearch, :plchanges, :tagtypes, :commands, :notcommands, :urlhandlers,
|
52
52
|
:decoders, :listplaylistinfo, :playlistinfo]
|
@@ -131,14 +131,15 @@ class MPD
|
|
131
131
|
#
|
132
132
|
# @return [Array<Hash>, Array<String>, String, Integer] Parsed response.
|
133
133
|
def parse_response(command, string)
|
134
|
-
#
|
135
|
-
return RETURN_ARRAY.include?(command) ? [] : true if string.empty?
|
136
|
-
if command == :listall
|
134
|
+
if command == :listall # Explicitly handle :listall (#files) -> always return a Hash
|
137
135
|
return build_hash(string)
|
138
136
|
elsif command == :listallinfo
|
139
137
|
string = filter_lines(string, [:directory, :playlist])
|
140
138
|
end
|
141
139
|
|
140
|
+
# return explicit array or true if the message is empty
|
141
|
+
return RETURN_ARRAY.include?(command) ? [] : true if string.empty?
|
142
|
+
|
142
143
|
build_response(command, string)
|
143
144
|
end
|
144
145
|
|
data/lib/ruby-mpd/version.rb
CHANGED