officialfm 0.0.3 → 0.0.4
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.
- data/README.md +0 -22
- data/changelog.md +3 -0
- data/lib/officialfm/playlists.rb +0 -2
- data/lib/officialfm/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -35,28 +35,6 @@ this gem, see [ofmtweet](https://github.com/nddrylliog/ofmtweet).
|
|
35
35
|
|
36
36
|
## Additions to the original API
|
37
37
|
|
38
|
-
### playlist.tracks
|
39
|
-
|
40
|
-
For the time being, the structure of playlists in the JSON response of the official.fm
|
41
|
-
server is:
|
42
|
-
|
43
|
-
{
|
44
|
-
"tracks_count":4,
|
45
|
-
"tracks_list":"57854,40057,11290,12818",
|
46
|
-
}
|
47
|
-
|
48
|
-
It'd be more convenient to have something like:
|
49
|
-
|
50
|
-
{
|
51
|
-
"tracks": [ 57854, 40057, 11290, 12818 ],
|
52
|
-
}
|
53
|
-
|
54
|
-
But until it's fixed, this gem emulates it, so you can still write pretty code like:
|
55
|
-
|
56
|
-
officialfm.playlists('R&B', :limit => 1)[0].tracks.do |track|
|
57
|
-
puts " * #{officialfm.track(track).title}"
|
58
|
-
end
|
59
|
-
|
60
38
|
### playlist.running\_time
|
61
39
|
|
62
40
|
The original API has a `length` attribute in playlists, but unfortunately
|
data/changelog.md
CHANGED
data/lib/officialfm/playlists.rb
CHANGED
@@ -46,8 +46,6 @@ module OfficialFM
|
|
46
46
|
def improve(playlist)
|
47
47
|
# the length field is already used. Note: running_time is in seconds
|
48
48
|
playlist.running_time = playlist["length"]
|
49
|
-
# Our own little hack to make it a lot easier to handle, until the API is improved.
|
50
|
-
playlist.tracks = playlist.tracks_list.split(',').map do |x| x.to_i end
|
51
49
|
playlist
|
52
50
|
end
|
53
51
|
|
data/lib/officialfm/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: officialfm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Amos Wenger
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-20 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|