douban.fm 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,7 +36,12 @@ douban_fm.select_channel(0)
36
36
 
37
37
  play_proc = proc do |waiting|
38
38
  if waiting
39
- douban_fm.get_next_playlist
39
+ begin
40
+ douban_fm.get_next_playlist
41
+ rescue
42
+ douban_fm.login
43
+ end
44
+
40
45
  douban_fm.play_current_playlist do |waiting|
41
46
  play_proc.call(waiting)
42
47
  end
@@ -52,6 +52,10 @@ module DoubanFM
52
52
  res = Net::HTTP.get_response(uri)
53
53
 
54
54
  @current_playlist = JSON.parse(res.body)
55
+
56
+ unless @current_playlist['err'].nil?
57
+ raise @current_playlist
58
+ end
55
59
  end
56
60
 
57
61
  def play_current_playlist
@@ -1,3 +1,3 @@
1
1
  module DoubanFM
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: douban.fm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-16 00:00:00.000000000 Z
12
+ date: 2013-01-17 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: douban.fm
15
15
  email:
@@ -49,9 +49,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  version: '0'
50
50
  requirements: []
51
51
  rubyforge_project:
52
- rubygems_version: 1.8.15
52
+ rubygems_version: 1.8.24
53
53
  signing_key:
54
54
  specification_version: 3
55
55
  summary: douban.fm
56
56
  test_files: []
57
- has_rdoc: