dacpclient 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dacpclient +10 -3
- data/dacpclient.gemspec +3 -3
- data/lib/dacpclient/browser.rb +2 -2
- data/lib/dacpclient/client.rb +1 -1
- data/lib/dacpclient/pairingserver.rb +2 -2
- data/lib/dacpclient/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98de2006393ea258320fc611a9d344d83d0feb58
|
4
|
+
data.tar.gz: 841fb499caf9bc84be3c8475c178af7a4537ad80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63854bcdbf6ee860bccf7844c8b054d5ef9e948cbdad86b843c9028b613a236b9645210f149ea073f028fc48cba1d2a9af1fb1e3328b4af283f70cf46c8cf5c2
|
7
|
+
data.tar.gz: ab1071e5f4518088e9bbc52f90f1f654826c23f0dbf846f808c732b3cf6c268419e4a3a02daa6d636f13aa8ab25dc2f379f45d90763202885100b0fbfc2d5e6e
|
data/bin/dacpclient
CHANGED
@@ -87,24 +87,28 @@ class CLIClient < Thor
|
|
87
87
|
def play
|
88
88
|
login
|
89
89
|
@client.play
|
90
|
+
show_status
|
90
91
|
end
|
91
92
|
|
92
93
|
desc :pause, 'Pause Playing'
|
93
94
|
def pause
|
94
95
|
login
|
95
96
|
@client.pause
|
97
|
+
show_status
|
96
98
|
end
|
97
99
|
|
98
100
|
desc :playpause, 'Toggle Playing'
|
99
101
|
def playpause
|
100
102
|
login
|
101
103
|
@client.playpause
|
104
|
+
show_status
|
102
105
|
end
|
103
106
|
|
104
107
|
desc :next, 'Go to next item'
|
105
108
|
def next
|
106
109
|
login
|
107
110
|
@client.next
|
111
|
+
show_status
|
108
112
|
end
|
109
113
|
|
110
114
|
desc :prev, 'Go to previous item'
|
@@ -112,6 +116,7 @@ class CLIClient < Thor
|
|
112
116
|
def prev
|
113
117
|
login
|
114
118
|
@client.prev
|
119
|
+
show_status
|
115
120
|
end
|
116
121
|
|
117
122
|
desc :playlists, 'Show the playlists'
|
@@ -141,12 +146,14 @@ class CLIClient < Thor
|
|
141
146
|
puts "#{title} - #{artist} (#{album}) [#{format_time(item.song_time)}]"
|
142
147
|
end
|
143
148
|
puts
|
149
|
+
show_status
|
144
150
|
end
|
145
151
|
|
146
152
|
desc :stop, 'Stop playing'
|
147
153
|
def stop
|
148
154
|
login
|
149
155
|
@client.stop
|
156
|
+
show_status
|
150
157
|
end
|
151
158
|
|
152
159
|
# rubocop:disable Debugger
|
@@ -166,7 +173,7 @@ class CLIClient < Thor
|
|
166
173
|
def version
|
167
174
|
puts "DACPClient v#{DACPClient::VERSION}"
|
168
175
|
puts "using DMAPParser v#{DMAPParser::VERSION}"
|
169
|
-
print
|
176
|
+
print 'DACPClient and DMAPParser are Copyright (c) '
|
170
177
|
puts "#{Time.now.year} Jurriaan Pruis"
|
171
178
|
end
|
172
179
|
|
@@ -227,9 +234,9 @@ class CLIClient < Thor
|
|
227
234
|
minutes, seconds = seconds.divmod(60)
|
228
235
|
hours, minutes = minutes.divmod(60)
|
229
236
|
if hours == 0
|
230
|
-
|
237
|
+
format('%02d:%02d', minutes, seconds)
|
231
238
|
else
|
232
|
-
|
239
|
+
format('%02d:%02d:%02d', hours, minutes, seconds)
|
233
240
|
end
|
234
241
|
end
|
235
242
|
|
data/dacpclient.gemspec
CHANGED
@@ -23,13 +23,13 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_runtime_dependency 'dnssd', '~> 2.0'
|
24
24
|
spec.add_runtime_dependency 'plist', '~> 3.1.0'
|
25
25
|
spec.add_runtime_dependency 'dmapparser', '~> 0.0.2'
|
26
|
-
spec.add_runtime_dependency 'thor', '~> 0.
|
26
|
+
spec.add_runtime_dependency 'thor', '~> 0.19.1'
|
27
27
|
|
28
28
|
spec.add_development_dependency 'yard'
|
29
29
|
spec.add_development_dependency 'redcarpet'
|
30
30
|
spec.add_development_dependency 'github-markup'
|
31
|
-
spec.add_development_dependency 'minitest', '~> 5.
|
32
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
31
|
+
spec.add_development_dependency 'minitest', '~> 5.3.1'
|
32
|
+
spec.add_development_dependency 'rubocop', '~> 0.19.1'
|
33
33
|
spec.add_development_dependency 'rake'
|
34
34
|
|
35
35
|
spec.required_ruby_version = '>= 2.0.0'
|
data/lib/dacpclient/browser.rb
CHANGED
@@ -6,11 +6,11 @@ module DACPClient
|
|
6
6
|
class Browser
|
7
7
|
class Device < Struct.new(:host, :port, :text_records)
|
8
8
|
def name
|
9
|
-
text_records['Machine Name'] || text_records['CtlN']
|
9
|
+
text_records['Machine Name'] || text_records['CtlN']
|
10
10
|
end
|
11
11
|
|
12
12
|
def database_id
|
13
|
-
text_records['Database ID'] || text_records['DbId']
|
13
|
+
text_records['Database ID'] || text_records['DbId']
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
data/lib/dacpclient/client.rb
CHANGED
@@ -270,7 +270,7 @@ module DACPClient
|
|
270
270
|
action = '/ctrl-int/1' + action unless clean_url
|
271
271
|
end
|
272
272
|
params['hsgid'] = @hsgid unless @hsgid.nil?
|
273
|
-
|
273
|
+
|
274
274
|
result = @client.get do |request|
|
275
275
|
request.options.params_encoder = Faraday::FlatterParamsEncoder
|
276
276
|
request.url action
|
@@ -26,7 +26,7 @@ module DACPClient
|
|
26
26
|
@pairing_string = generate_pairing_string(@pair, @name, @device_type)
|
27
27
|
@expected = PairingServer.generate_pin_challenge(@pair, @pin)
|
28
28
|
@service = DNSSD.register!(@name, MDNS_TYPE, 'local', @port, text_record)
|
29
|
-
|
29
|
+
|
30
30
|
PairInfo.new(DMAPParser::Parser.parse(@pairing_string))
|
31
31
|
super
|
32
32
|
join
|
@@ -51,7 +51,7 @@ module DACPClient
|
|
51
51
|
device.host == peer_addr
|
52
52
|
end
|
53
53
|
if data =~ /pairingcode=#{@expected}/i && @peer
|
54
|
-
client.print "HTTP/1.1 200 OK\n"
|
54
|
+
client.print "HTTP/1.1 200 OK\n" \
|
55
55
|
"Content-Length: #{@pairing_string.length}\n\n"
|
56
56
|
client.print @pairing_string
|
57
57
|
client.close
|
data/lib/dacpclient/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dacpclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jurriaan Pruis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.19.1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.19.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: yard
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,28 +128,28 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 5.
|
131
|
+
version: 5.3.1
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 5.
|
138
|
+
version: 5.3.1
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rubocop
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 0.19.1
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: 0.19.1
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rake
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|