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 +3 -3
- data/lib/LOLastfm/song.rb +2 -10
- data/lib/LOLastfm/version.rb +1 -1
- metadata +2 -2
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
|
-
|
57
|
-
|
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!
|
data/lib/LOLastfm/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2012-07-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: lastfm
|