ayadn 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/ayadn/action.rb +1 -1
- data/lib/ayadn/nowplaying.rb +15 -34
- data/lib/ayadn/version.rb +1 -1
- data/spec/mock/ayadn.sqlite +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b5f20d344841d76ea6958dcb51032bfed8992ec
|
4
|
+
data.tar.gz: 5ab42f2b2eb18f2713ed4b8ce191d5a833f3da96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad72ea71606ddee934d7d6c1a6ac9508bfe2f0c88a893a7a86462fa43409081626270d0241d302b393d679e0fef3a43ec7d6365e7f4379655dd9ea2874f5bbe5
|
7
|
+
data.tar.gz: dfd9d769dcd06f22ba4a68309308aa7a9133d2d2d6882485fc99c7f5b5ae873595ea4ee1a528aef0ce943435d4685a225b123ce5c89b5505c920bda6f6cfac13
|
data/CHANGELOG.md
CHANGED
data/lib/ayadn/action.rb
CHANGED
@@ -569,7 +569,7 @@ module Ayadn
|
|
569
569
|
exit
|
570
570
|
end
|
571
571
|
unread_messages = {}
|
572
|
-
unread_channels.each do |id|
|
572
|
+
unread_channels.reverse.each do |id|
|
573
573
|
@thor.say_status :downloading, "messages from channel #{id}"
|
574
574
|
since = Databases.find_last_id_from("channel:#{id}")
|
575
575
|
unless since.nil?
|
data/lib/ayadn/nowplaying.rb
CHANGED
@@ -179,40 +179,9 @@ module Ayadn
|
|
179
179
|
|
180
180
|
def get_itunes_store url, artist, track
|
181
181
|
results = JSON.load(CNX.download(URI.escape(url)))['results']
|
182
|
-
# puts results.inspect
|
183
|
-
unless results.empty? || results.nil?
|
184
|
-
# results.each {|obj| puts obj['trackName']}
|
185
|
-
# puts "-"
|
186
|
-
# puts track
|
187
|
-
one = results.select do |obj|
|
188
|
-
next if obj['trackName'].nil?
|
189
|
-
obj['trackName'].downcase == track.downcase
|
190
|
-
end
|
191
|
-
# puts one.inspect
|
192
|
-
if one.empty?
|
193
|
-
by_artist = results.select do |obj|
|
194
|
-
next if obj['artistName'].nil?
|
195
|
-
obj['artistName'].downcase == artist.downcase
|
196
|
-
end
|
197
|
-
# puts by_artist
|
198
|
-
by_exact_track = by_artist.select do |obj|
|
199
|
-
next if obj['trackName'].nil?
|
200
|
-
obj['trackName'].downcase == track.downcase
|
201
|
-
end
|
202
|
-
# puts by_exact_track
|
203
|
-
if by_exact_track.empty?
|
204
|
-
splitted = track.split(" ").first.downcase
|
205
|
-
results = by_artist.select do |obj|
|
206
|
-
next if obj['trackName'].nil?
|
207
|
-
obj['trackName'].split(" ").first.downcase == splitted
|
208
|
-
end
|
209
|
-
else
|
210
|
-
results = by_exact_track
|
211
|
-
end
|
212
182
|
|
213
|
-
|
214
|
-
|
215
|
-
end
|
183
|
+
# puts results.inspect
|
184
|
+
unless results.nil?
|
216
185
|
|
217
186
|
if results.empty?
|
218
187
|
return {
|
@@ -221,7 +190,19 @@ module Ayadn
|
|
221
190
|
}
|
222
191
|
end
|
223
192
|
|
224
|
-
|
193
|
+
candidates = []
|
194
|
+
candidates_track = results.map { |e| e if e['trackName'].downcase == track.downcase }.compact
|
195
|
+
candidates_track.each do |e|
|
196
|
+
next if e['artistName'].nil?
|
197
|
+
candidates << e if e['artistName'].downcase == artist.downcase
|
198
|
+
end
|
199
|
+
# require "pp";pp candidates; exit
|
200
|
+
|
201
|
+
candidate = if candidates.empty?
|
202
|
+
results[0]
|
203
|
+
else
|
204
|
+
candidates[0]
|
205
|
+
end
|
225
206
|
|
226
207
|
return {
|
227
208
|
'code' => 200,
|
data/lib/ayadn/version.rb
CHANGED
data/spec/mock/ayadn.sqlite
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ayadn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Dejonckheere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|