rdio 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rdio.rb +0 -5
- data/lib/rdio/types.rb +10 -0
- metadata +3 -3
data/lib/rdio.rb
CHANGED
@@ -50,11 +50,6 @@ module Rdio
|
|
50
50
|
@api = Api.new key,secret
|
51
51
|
end
|
52
52
|
|
53
|
-
# Resets -- mainly for oauth
|
54
|
-
def self.reset
|
55
|
-
@api = nil
|
56
|
-
end
|
57
|
-
|
58
53
|
# Returns the shared Rdio::Api instance. If it hasn't been set, we
|
59
54
|
# try to construct it from thte environment
|
60
55
|
def self.api
|
data/lib/rdio/types.rb
CHANGED
@@ -31,6 +31,11 @@ module Rdio
|
|
31
31
|
def tracks(appears_on=nil,start=nil,count=nil,extras=nil)
|
32
32
|
api.getTracksForArtist self,appears_on,start,count,extras
|
33
33
|
end
|
34
|
+
|
35
|
+
# Get all the albums by this artist
|
36
|
+
def albums(featuring=nil,extras=nil,start=nil,count=nil)
|
37
|
+
api.getAlbumsForArtist self,featuring,extras,start,count
|
38
|
+
end
|
34
39
|
|
35
40
|
# Which tracks from the given artist are in the user's collection.
|
36
41
|
def tracks_in_collection(user=nil,extras=nil)
|
@@ -306,6 +311,11 @@ module Rdio
|
|
306
311
|
Rdio::api.findUserByVanityName name
|
307
312
|
end
|
308
313
|
|
314
|
+
# Finds the user by email or vanity name
|
315
|
+
def self.find(s)
|
316
|
+
s =~ /@/ ? find_by_email(s) : find_by_vanity_name(s)
|
317
|
+
end
|
318
|
+
|
309
319
|
# Fetch one or more objects from Rdio of type User.
|
310
320
|
def self.all(keys)
|
311
321
|
Rdio::api.get keys,User
|
metadata
CHANGED