itunes_api 2.2.0 → 2.2.1
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/itunes_api/music/results/song.rb +7 -3
- data/lib/itunes_api/music/song.rb +7 -3
- data/lib/itunes_api/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: 4968e1787495e239562f482f84c6b924c303454b
|
4
|
+
data.tar.gz: '08631cad8bd39b7284c1aa7130073773f1db561e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cceeb91164a8d6df0d9046c7a44ed694d2d58afd0afd49be1c1dabad94627ea9ec6316161121b9cc95d4e5b83a73f66290154c6dd5ab24dc864783266d732ad
|
7
|
+
data.tar.gz: 231a24a2780b9b6a33f49ffb7459bba6f7f1a200da38db58a68d3d522dcfef0c9d75533c4d5ab641492ea654411b39cab7b2eccda2f9b2b569bd9ef44525e823
|
@@ -70,9 +70,13 @@ module ItunesApi
|
|
70
70
|
private
|
71
71
|
|
72
72
|
def track_lenght(milliseconds)
|
73
|
-
|
74
|
-
|
75
|
-
|
73
|
+
if milliseconds.to_i > 0
|
74
|
+
minutes, milliseconds = milliseconds.divmod(1000 * 60)
|
75
|
+
seconds = milliseconds / 1000
|
76
|
+
"#{minutes}:#{seconds}"
|
77
|
+
else
|
78
|
+
'-:--'
|
79
|
+
end
|
76
80
|
end
|
77
81
|
end
|
78
82
|
end
|
@@ -15,8 +15,6 @@ module ItunesApi
|
|
15
15
|
:streamable,
|
16
16
|
:track_id
|
17
17
|
|
18
|
-
alias streamable? streamable
|
19
|
-
|
20
18
|
class << self
|
21
19
|
def find_by_collection_id(collection_id, store)
|
22
20
|
songs(collection_id, store).map { |song| new(*song.attributes) }
|
@@ -39,6 +37,12 @@ module ItunesApi
|
|
39
37
|
explicitness == 'explicit'
|
40
38
|
end
|
41
39
|
|
40
|
+
def streamable?
|
41
|
+
return false if streamable.nil?
|
42
|
+
|
43
|
+
streamable
|
44
|
+
end
|
45
|
+
|
42
46
|
def to_hash
|
43
47
|
{
|
44
48
|
album: album,
|
@@ -51,7 +55,7 @@ module ItunesApi
|
|
51
55
|
number: number,
|
52
56
|
preview: preview,
|
53
57
|
store: store,
|
54
|
-
streamable: streamable
|
58
|
+
streamable: streamable?,
|
55
59
|
track_id: track_id
|
56
60
|
}
|
57
61
|
end
|
data/lib/itunes_api/version.rb
CHANGED