LOLastfm 0.0.3.2 → 0.0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/LOLastfm.rb CHANGED
@@ -164,15 +164,15 @@ class LOLastfm
164
164
  return false unless fire :listened, song
165
165
 
166
166
  @cache.flush!
167
- @now_playing = nil
168
167
 
169
168
  return false if song.nil?
170
169
 
170
+ @now_playing = nil
171
+ @last_played = song
172
+
171
173
  unless listened! song
172
174
  @cache.listened(song)
173
175
  end
174
-
175
- @last_played = song
176
176
 
177
177
  true
178
178
  end
data/lib/LOLastfm/song.rb CHANGED
@@ -53,21 +53,13 @@ class Song
53
53
 
54
54
  if @listened_at
55
55
  @listened_at = @listened_at.is_a?(String) ? DateTime.parse(@listened_at) : @listened_at.to_datetime
56
- end
57
- end
58
-
59
- def listened_at
60
- return @listened_at if @listened_at
61
-
62
- unless nil? || @listened_at
63
- if @length && !stream?
56
+ else
57
+ if @length
64
58
  @listened_at = (Time.now - @length).to_datetime
65
59
  else
66
60
  @listened_at = DateTime.now
67
61
  end
68
62
  end
69
-
70
- @listened_at
71
63
  end
72
64
 
73
65
  def fill!
@@ -10,6 +10,6 @@
10
10
 
11
11
  class LOLastfm
12
12
  def self.version
13
- '0.0.3.2'
13
+ '0.0.3.3'
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: LOLastfm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.2
4
+ version: 0.0.3.3
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: 2012-07-03 00:00:00.000000000 Z
12
+ date: 2012-07-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: lastfm