7digital 0.1.2 → 0.1.5
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.
- checksums.yaml +7 -0
- data/README.rdoc +143 -143
- data/lib/sevendigital.rb +55 -55
- data/lib/sevendigital/api_operator.rb +127 -127
- data/lib/sevendigital/api_operator_cached.rb +91 -62
- data/lib/sevendigital/api_request.rb +72 -62
- data/lib/sevendigital/client.rb +122 -122
- data/lib/sevendigital/client_configuration.rb +85 -83
- data/lib/sevendigital/client_digestors.rb +122 -122
- data/lib/sevendigital/client_managers.rb +57 -57
- data/lib/sevendigital/digestion_tract/api_response_digestor.rb +48 -48
- data/lib/sevendigital/digestion_tract/artist_digestor.rb +35 -35
- data/lib/sevendigital/digestion_tract/basket_digestor.rb +19 -19
- data/lib/sevendigital/digestion_tract/basket_item_digestor.rb +26 -26
- data/lib/sevendigital/digestion_tract/chart_item_digestor.rb +34 -34
- data/lib/sevendigital/digestion_tract/country_digestor.rb +15 -15
- data/lib/sevendigital/digestion_tract/digestor.rb +122 -122
- data/lib/sevendigital/digestion_tract/download_url_digestor.rb +23 -23
- data/lib/sevendigital/digestion_tract/format_digestor.rb +24 -24
- data/lib/sevendigital/digestion_tract/label_digestor.rb +21 -21
- data/lib/sevendigital/digestion_tract/list_digestor.rb +24 -24
- data/lib/sevendigital/digestion_tract/list_item_digestor.rb +26 -26
- data/lib/sevendigital/digestion_tract/locker_digestor.rb +22 -22
- data/lib/sevendigital/digestion_tract/locker_release_digestor.rb +26 -26
- data/lib/sevendigital/digestion_tract/locker_track_digestor.rb +26 -26
- data/lib/sevendigital/digestion_tract/oauth_access_token_digestor.rb +18 -18
- data/lib/sevendigital/digestion_tract/oauth_request_token_digestor.rb +18 -18
- data/lib/sevendigital/digestion_tract/pager_digestor.rb +28 -28
- data/lib/sevendigital/digestion_tract/price_digestor.rb +28 -28
- data/lib/sevendigital/digestion_tract/release_digestor.rb +45 -45
- data/lib/sevendigital/digestion_tract/tag_digestor.rb +23 -23
- data/lib/sevendigital/digestion_tract/track_digestor.rb +38 -37
- data/lib/sevendigital/digestion_tract/user_card_digestor.rb +24 -24
- data/lib/sevendigital/digestion_tract/user_digestor.rb +21 -21
- data/lib/sevendigital/management/artist_manager.rb +97 -97
- data/lib/sevendigital/management/basket_manager.rb +29 -29
- data/lib/sevendigital/management/country_manager.rb +10 -10
- data/lib/sevendigital/management/list_manager.rb +18 -18
- data/lib/sevendigital/management/manager.rb +12 -12
- data/lib/sevendigital/management/oauth_manager.rb +23 -23
- data/lib/sevendigital/management/release_manager.rb +54 -54
- data/lib/sevendigital/management/tag_manager.rb +10 -10
- data/lib/sevendigital/management/track_manager.rb +29 -27
- data/lib/sevendigital/management/user_card_manager.rb +26 -26
- data/lib/sevendigital/management/user_manager.rb +76 -76
- data/lib/sevendigital/model/api_response.rb +32 -32
- data/lib/sevendigital/model/artist.rb +104 -104
- data/lib/sevendigital/model/basket.rb +15 -15
- data/lib/sevendigital/model/basket_item.rb +14 -14
- data/lib/sevendigital/model/card.rb +11 -11
- data/lib/sevendigital/model/chart_item.rb +9 -9
- data/lib/sevendigital/model/download_url.rb +7 -7
- data/lib/sevendigital/model/format.rb +7 -7
- data/lib/sevendigital/model/label.rb +7 -7
- data/lib/sevendigital/model/list.rb +4 -4
- data/lib/sevendigital/model/list_item.rb +8 -8
- data/lib/sevendigital/model/locker.rb +4 -4
- data/lib/sevendigital/model/locker_release.rb +9 -9
- data/lib/sevendigital/model/locker_track.rb +9 -9
- data/lib/sevendigital/model/price.rb +9 -9
- data/lib/sevendigital/model/release.rb +57 -57
- data/lib/sevendigital/model/sevendigital_error.rb +11 -11
- data/lib/sevendigital/model/sevendigital_object.rb +57 -57
- data/lib/sevendigital/model/tag.rb +7 -7
- data/lib/sevendigital/model/track.rb +87 -83
- data/lib/sevendigital/model/user.rb +74 -74
- data/lib/sevendigital/pager.rb +20 -20
- data/lib/sevendigital/version.rb +5 -5
- data/spec/api_operator_cached_spec.rb +233 -178
- data/spec/api_operator_spec.rb +320 -320
- data/spec/api_request_spec.rb +46 -31
- data/spec/client_configuration_spec.rb +78 -78
- data/spec/client_spec.rb +161 -161
- data/spec/data/config/sevendigital.yml +5 -5
- data/spec/data/configuration_env_override.yml +5 -5
- data/spec/data/configuration_override.yml +1 -1
- data/spec/digestion_tract/api_response_digestor_spec.rb +93 -93
- data/spec/digestion_tract/artist_digestor_spec.rb +81 -81
- data/spec/digestion_tract/basket_digestor_spec.rb +31 -31
- data/spec/digestion_tract/basket_item_digestor_spec.rb +58 -58
- data/spec/digestion_tract/chart_digestor_spec.rb +52 -52
- data/spec/digestion_tract/country_digestor_spec.rb +33 -33
- data/spec/digestion_tract/digestor_spec.rb +33 -33
- data/spec/digestion_tract/download_url_digestor_spec.rb +40 -40
- data/spec/digestion_tract/format_digestor_spec.rb +38 -38
- data/spec/digestion_tract/label_digestor_spec.rb +33 -33
- data/spec/digestion_tract/list_digestor_spec.rb +31 -31
- data/spec/digestion_tract/list_item_digestor_spec.rb +80 -80
- data/spec/digestion_tract/locker_digestor_spec.rb +30 -30
- data/spec/digestion_tract/locker_release_digestor_spec.rb +70 -70
- data/spec/digestion_tract/locker_track_digestor_spec.rb +56 -56
- data/spec/digestion_tract/oauth_access_token_digestor_spec.rb +34 -34
- data/spec/digestion_tract/oauth_request_token_digestor_spec.rb +34 -34
- data/spec/digestion_tract/pager_digestor_spec.rb +50 -50
- data/spec/digestion_tract/price_digestor_spec.rb +73 -73
- data/spec/digestion_tract/release_digestor_spec.rb +115 -115
- data/spec/digestion_tract/tag_digestor_spec.rb +46 -46
- data/spec/digestion_tract/track_digestor_spec.rb +105 -104
- data/spec/digestion_tract/user_card_digestor_spec.rb +58 -58
- data/spec/digestion_tract/user_digestor_spec.rb +42 -42
- data/spec/integration/artist_spec.rb +99 -86
- data/spec/integration/country_spec.rb +18 -18
- data/spec/integration/list_spec.rb +22 -22
- data/spec/integration/purchasing_spec.rb +24 -24
- data/spec/integration/release_spec.rb +34 -34
- data/spec/integration/sevendigital_spec.yml +4 -4
- data/spec/integration/track_spec.rb +38 -23
- data/spec/integration/user_spec.rb +22 -22
- data/spec/management/artist_manager_spec.rb +172 -172
- data/spec/management/basket_manager_spec.rb +77 -77
- data/spec/management/country_manager_spec.rb +34 -34
- data/spec/management/list_manager_spec.rb +26 -26
- data/spec/management/oauth_manager_spec.rb +72 -72
- data/spec/management/release_manager_spec.rb +200 -200
- data/spec/management/tag_manager_spec.rb +34 -34
- data/spec/management/track_manager_spec.rb +111 -107
- data/spec/management/user_card_manager_spec.rb +78 -78
- data/spec/management/user_manager_spec.rb +218 -218
- data/spec/model/api_response_spec.rb +48 -48
- data/spec/model/artist_spec.rb +162 -162
- data/spec/model/basket_spec.rb +62 -62
- data/spec/model/release_spec.rb +133 -133
- data/spec/model/sevendigital_object_spec.rb +73 -73
- data/spec/model/track_spec.rb +146 -144
- data/spec/model/user_spec.rb +181 -181
- data/spec/spec_helper.rb +86 -84
- data/spec/test-xml/methods/artist/browse.xml +21 -21
- data/spec/test-xml/methods/artist/byTag/top.xml +50 -50
- data/spec/test-xml/methods/artist/chart.xml +30 -30
- data/spec/test-xml/methods/artist/details.xml +9 -9
- data/spec/test-xml/methods/artist/releases.xml +544 -544
- data/spec/test-xml/methods/artist/search.xml +18 -18
- data/spec/test-xml/methods/artist/similar.xml +39 -39
- data/spec/test-xml/methods/artist/tags.xml +11 -11
- data/spec/test-xml/methods/artist/toptracks.xml +279 -279
- data/spec/test-xml/methods/basket/additem.xml +23 -23
- data/spec/test-xml/methods/basket/create.xml +10 -10
- data/spec/test-xml/methods/basket/index.xml +23 -23
- data/spec/test-xml/methods/basket/removeitem.xml +10 -10
- data/spec/test-xml/methods/country/resolve.xml +6 -6
- data/spec/test-xml/methods/editorial/list.xml +170 -170
- data/spec/test-xml/methods/oauth/accesstoken.xml +5 -5
- data/spec/test-xml/methods/oauth/requesttoken.xml +5 -5
- data/spec/test-xml/methods/release/bydate.xml +173 -173
- data/spec/test-xml/methods/release/bytag/top.xml +150 -150
- data/spec/test-xml/methods/release/chart.xml +181 -181
- data/spec/test-xml/methods/release/details.xml +48 -48
- data/spec/test-xml/methods/release/recommend.xml +89 -89
- data/spec/test-xml/methods/release/search.xml +194 -194
- data/spec/test-xml/methods/release/tags.xml +27 -27
- data/spec/test-xml/methods/release/tracks.xml +28 -28
- data/spec/test-xml/methods/tag/index.xml +16 -16
- data/spec/test-xml/methods/track/chart.xml +149 -149
- data/spec/test-xml/methods/track/details.xml +30 -30
- data/spec/test-xml/methods/track/search.xml +159 -159
- data/spec/test-xml/methods/user/details.xml +4 -4
- data/spec/test-xml/methods/user/locker.xml +49 -49
- data/spec/test-xml/methods/user/payment/card/add.xml +7 -7
- data/spec/test-xml/methods/user/payment/card/index.xml +7 -7
- data/spec/test-xml/methods/user/purchase/basket.xml +48 -48
- data/spec/test-xml/methods/user/purchase/item.xml +48 -48
- data/spec/test-xml/methods/user/signUp.xml +5 -5
- data/spec/test-xml/objects/artist.xml +7 -7
- data/spec/test-xml/objects/artist_chart_item.xml +7 -7
- data/spec/test-xml/objects/artist_list.xml +22 -22
- data/spec/test-xml/objects/artist_list_empty.xml +4 -4
- data/spec/test-xml/objects/basket.xml +21 -21
- data/spec/test-xml/objects/basket_item.xml +11 -11
- data/spec/test-xml/objects/basket_item_list.xml +25 -25
- data/spec/test-xml/objects/basket_item_list_empty.xml +1 -1
- data/spec/test-xml/objects/download_url.xml +7 -7
- data/spec/test-xml/objects/list.xml +89 -89
- data/spec/test-xml/objects/list_item_list.xml +85 -85
- data/spec/test-xml/objects/list_item_release.xml +13 -13
- data/spec/test-xml/objects/locker.xml +47 -47
- data/spec/test-xml/objects/locker_release.xml +40 -40
- data/spec/test-xml/objects/locker_release_list.xml +87 -87
- data/spec/test-xml/objects/locker_release_list_empty.xml +4 -4
- data/spec/test-xml/objects/locker_release_one_item_list.xml +43 -43
- data/spec/test-xml/objects/locker_track.xml +25 -25
- data/spec/test-xml/objects/locker_track_list.xml +26 -26
- data/spec/test-xml/objects/locker_track_list_empty.xml +2 -2
- data/spec/test-xml/objects/nested_release_list.xml +22 -22
- data/spec/test-xml/objects/oauth_access_token.xml +3 -3
- data/spec/test-xml/objects/oauth_request_token.xml +3 -3
- data/spec/test-xml/objects/price.xml +7 -7
- data/spec/test-xml/objects/release.xml +40 -40
- data/spec/test-xml/objects/release_chart_item.xml +39 -39
- data/spec/test-xml/objects/release_list.xml +18 -18
- data/spec/test-xml/objects/release_list_empty.xml +4 -4
- data/spec/test-xml/objects/response.xml +38 -38
- data/spec/test-xml/objects/tag.xml +4 -4
- data/spec/test-xml/objects/track.xml +34 -33
- data/spec/test-xml/objects/track_chart_item.xml +27 -27
- data/spec/test-xml/objects/user.xml +4 -4
- data/spec/test-xml/objects/user_payment_card.xml +5 -5
- metadata +15 -25
@@ -1,33 +1,33 @@
|
|
1
|
-
module Sevendigital
|
2
|
-
|
3
|
-
#Holds the complete API response
|
4
|
-
class ApiResponse
|
5
|
-
|
6
|
-
attr_accessor :error_code, :error_message, :content, :headers
|
7
|
-
|
8
|
-
#True if no API error has been returned
|
9
|
-
def ok?
|
10
|
-
(@error_code == 0 && !@content.nil?)
|
11
|
-
end
|
12
|
-
|
13
|
-
def content_xml
|
14
|
-
@content_xml ||= Nokogiri::XML(@content)
|
15
|
-
end
|
16
|
-
|
17
|
-
def item_xml(element_name)
|
18
|
-
content_xml.at_xpath("./response/#{element_name}")
|
19
|
-
end
|
20
|
-
|
21
|
-
def _dump(depth)
|
22
|
-
Marshal.dump([@error_code, @error_message, @headers, @content])
|
23
|
-
end
|
24
|
-
|
25
|
-
def self._load(properties)
|
26
|
-
response = ApiResponse.new
|
27
|
-
response.error_code, response.error_message, response.headers, response.content = Marshal.load(properties)
|
28
|
-
response
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
|
1
|
+
module Sevendigital
|
2
|
+
|
3
|
+
#Holds the complete API response
|
4
|
+
class ApiResponse
|
5
|
+
|
6
|
+
attr_accessor :error_code, :error_message, :content, :headers
|
7
|
+
|
8
|
+
#True if no API error has been returned
|
9
|
+
def ok?
|
10
|
+
(@error_code == 0 && !@content.nil?)
|
11
|
+
end
|
12
|
+
|
13
|
+
def content_xml
|
14
|
+
@content_xml ||= Nokogiri::XML(@content)
|
15
|
+
end
|
16
|
+
|
17
|
+
def item_xml(element_name)
|
18
|
+
content_xml.at_xpath("./response/#{element_name}")
|
19
|
+
end
|
20
|
+
|
21
|
+
def _dump(depth)
|
22
|
+
Marshal.dump([@error_code, @error_message, @headers, @content])
|
23
|
+
end
|
24
|
+
|
25
|
+
def self._load(properties)
|
26
|
+
response = ApiResponse.new
|
27
|
+
response.error_code, response.error_message, response.headers, response.content = Marshal.load(properties)
|
28
|
+
response
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
33
|
end
|
@@ -1,105 +1,105 @@
|
|
1
|
-
module Sevendigital
|
2
|
-
|
3
|
-
#with lazy loading enabled these will be automatically populated by calling get_details
|
4
|
-
#==Extended properties
|
5
|
-
#with lazy loading enabled these will be automatically populated by calling the method in brackets
|
6
|
-
#additional options can be passed in when accessing lazy loaded properties, e.g.
|
7
|
-
# artist.releases({:page_size => 5, :image_size =>250})
|
8
|
-
|
9
|
-
class Artist < SevendigitalObject
|
10
|
-
|
11
|
-
#7digital artist ID
|
12
|
-
#@return [Integer]
|
13
|
-
attr_accessor :id
|
14
|
-
|
15
|
-
#artist's name
|
16
|
-
#@return [String]
|
17
|
-
attr_accessor :name
|
18
|
-
|
19
|
-
#Artist's name as it appears on the release or track (only available when artist is linked from release or track)
|
20
|
-
#@return [String]
|
21
|
-
attr_accessor :appears_as
|
22
|
-
|
23
|
-
#Artist name used for sorting, e.g. Beatles, The (optional lazy-loaded property)
|
24
|
-
#@return [String]
|
25
|
-
sevendigital_basic_property :sort_name
|
26
|
-
|
27
|
-
#Artist image URL (optional lazy-loaded property)
|
28
|
-
#@return [String]
|
29
|
-
sevendigital_basic_property :image
|
30
|
-
|
31
|
-
#Artist buy link URL (optional lazy-loaded property)
|
32
|
-
#@return [String]
|
33
|
-
sevendigital_basic_property :url
|
34
|
-
|
35
|
-
#popularity of the artist (lazy loaded using #get_tags)
|
36
|
-
#@return [decimal] similar
|
37
|
-
sevendigital_basic_property :popularity
|
38
|
-
|
39
|
-
#artist's releases (lazy loaded using get_releases)
|
40
|
-
#@return [Array<Release>]
|
41
|
-
sevendigital_extended_property :releases
|
42
|
-
|
43
|
-
#artist's top tracks (lazy loaded using get_top_tracks)
|
44
|
-
#@return [Array<Track>]
|
45
|
-
sevendigital_extended_property :top_tracks
|
46
|
-
|
47
|
-
#list of artists similar to this artist (lazy loaded using {#get_similar})
|
48
|
-
#@return [Array<Artist>] similar
|
49
|
-
sevendigital_extended_property :similar
|
50
|
-
|
51
|
-
#list of tags associated with the artist (lazy loaded using #get_tags)
|
52
|
-
#@return [Array<Artist>] similar
|
53
|
-
sevendigital_extended_property :tags
|
54
|
-
|
55
|
-
def image(image_size = nil)
|
56
|
-
return @image.gsub(/_\d+\.jpg/, "_#{image_size}.jpg") if image_size
|
57
|
-
@image
|
58
|
-
end
|
59
|
-
|
60
|
-
#populates all available details on artist by calling *artist/details* API method
|
61
|
-
#@return [Artist]
|
62
|
-
def get_details(options={})
|
63
|
-
artist_with_details = @api_client.artist.get_details(@id, options)
|
64
|
-
copy_basic_properties_from(artist_with_details)
|
65
|
-
artist_with_details
|
66
|
-
end
|
67
|
-
|
68
|
-
#releases by this artist retrieved by calling *artist/releases* API method
|
69
|
-
#@return [Array<Release>]
|
70
|
-
def get_releases(options={})
|
71
|
-
@api_client.artist.get_releases(@id, options)
|
72
|
-
end
|
73
|
-
|
74
|
-
#top tracks by this artist retrieved by calling *artist/topTracks* API method
|
75
|
-
#@return [Array<Track>]
|
76
|
-
def get_top_tracks(options={})
|
77
|
-
@api_client.artist.get_top_tracks(@id, options)
|
78
|
-
end
|
79
|
-
|
80
|
-
#artists similar to this artist retrieved by calling *artist/similar* API method
|
81
|
-
#@return [Array<Track>]
|
82
|
-
def get_similar(options={})
|
83
|
-
@similar = @api_client.artist.get_similar(@id, options)
|
84
|
-
end
|
85
|
-
|
86
|
-
#tags associated with this artist retrieved by calling *artist/tags* API method
|
87
|
-
#@return [Array<Tag>]
|
88
|
-
def get_tags(options={})
|
89
|
-
@api_client.artist.get_tags(@id, options)
|
90
|
-
end
|
91
|
-
|
92
|
-
#does this artist represents various artists?
|
93
|
-
#@return [Boolean]
|
94
|
-
def various?
|
95
|
-
joined_names = "#{name} #{appears_as}".downcase
|
96
|
-
|
97
|
-
various_variations = ["vario", "v???????????????rio", "v.a", "vaious", "varios" "vaious", "varoius", "variuos", \
|
98
|
-
"soundtrack", "karaoke", "original cast", "diverse artist"]
|
99
|
-
various_variations.each{|various_variation| return true if joined_names.include?(various_variation)}
|
100
|
-
return false
|
101
|
-
end
|
102
|
-
|
103
|
-
|
104
|
-
end
|
1
|
+
module Sevendigital
|
2
|
+
|
3
|
+
#with lazy loading enabled these will be automatically populated by calling get_details
|
4
|
+
#==Extended properties
|
5
|
+
#with lazy loading enabled these will be automatically populated by calling the method in brackets
|
6
|
+
#additional options can be passed in when accessing lazy loaded properties, e.g.
|
7
|
+
# artist.releases({:page_size => 5, :image_size =>250})
|
8
|
+
|
9
|
+
class Artist < SevendigitalObject
|
10
|
+
|
11
|
+
#7digital artist ID
|
12
|
+
#@return [Integer]
|
13
|
+
attr_accessor :id
|
14
|
+
|
15
|
+
#artist's name
|
16
|
+
#@return [String]
|
17
|
+
attr_accessor :name
|
18
|
+
|
19
|
+
#Artist's name as it appears on the release or track (only available when artist is linked from release or track)
|
20
|
+
#@return [String]
|
21
|
+
attr_accessor :appears_as
|
22
|
+
|
23
|
+
#Artist name used for sorting, e.g. Beatles, The (optional lazy-loaded property)
|
24
|
+
#@return [String]
|
25
|
+
sevendigital_basic_property :sort_name
|
26
|
+
|
27
|
+
#Artist image URL (optional lazy-loaded property)
|
28
|
+
#@return [String]
|
29
|
+
sevendigital_basic_property :image
|
30
|
+
|
31
|
+
#Artist buy link URL (optional lazy-loaded property)
|
32
|
+
#@return [String]
|
33
|
+
sevendigital_basic_property :url
|
34
|
+
|
35
|
+
#popularity of the artist (lazy loaded using #get_tags)
|
36
|
+
#@return [decimal] similar
|
37
|
+
sevendigital_basic_property :popularity
|
38
|
+
|
39
|
+
#artist's releases (lazy loaded using get_releases)
|
40
|
+
#@return [Array<Release>]
|
41
|
+
sevendigital_extended_property :releases
|
42
|
+
|
43
|
+
#artist's top tracks (lazy loaded using get_top_tracks)
|
44
|
+
#@return [Array<Track>]
|
45
|
+
sevendigital_extended_property :top_tracks
|
46
|
+
|
47
|
+
#list of artists similar to this artist (lazy loaded using {#get_similar})
|
48
|
+
#@return [Array<Artist>] similar
|
49
|
+
sevendigital_extended_property :similar
|
50
|
+
|
51
|
+
#list of tags associated with the artist (lazy loaded using #get_tags)
|
52
|
+
#@return [Array<Artist>] similar
|
53
|
+
sevendigital_extended_property :tags
|
54
|
+
|
55
|
+
def image(image_size = nil)
|
56
|
+
return @image.gsub(/_\d+\.jpg/, "_#{image_size}.jpg") if image_size
|
57
|
+
@image
|
58
|
+
end
|
59
|
+
|
60
|
+
#populates all available details on artist by calling *artist/details* API method
|
61
|
+
#@return [Artist]
|
62
|
+
def get_details(options={})
|
63
|
+
artist_with_details = @api_client.artist.get_details(@id, options)
|
64
|
+
copy_basic_properties_from(artist_with_details)
|
65
|
+
artist_with_details
|
66
|
+
end
|
67
|
+
|
68
|
+
#releases by this artist retrieved by calling *artist/releases* API method
|
69
|
+
#@return [Array<Release>]
|
70
|
+
def get_releases(options={})
|
71
|
+
@api_client.artist.get_releases(@id, options)
|
72
|
+
end
|
73
|
+
|
74
|
+
#top tracks by this artist retrieved by calling *artist/topTracks* API method
|
75
|
+
#@return [Array<Track>]
|
76
|
+
def get_top_tracks(options={})
|
77
|
+
@api_client.artist.get_top_tracks(@id, options)
|
78
|
+
end
|
79
|
+
|
80
|
+
#artists similar to this artist retrieved by calling *artist/similar* API method
|
81
|
+
#@return [Array<Track>]
|
82
|
+
def get_similar(options={})
|
83
|
+
@similar = @api_client.artist.get_similar(@id, options)
|
84
|
+
end
|
85
|
+
|
86
|
+
#tags associated with this artist retrieved by calling *artist/tags* API method
|
87
|
+
#@return [Array<Tag>]
|
88
|
+
def get_tags(options={})
|
89
|
+
@api_client.artist.get_tags(@id, options)
|
90
|
+
end
|
91
|
+
|
92
|
+
#does this artist represents various artists?
|
93
|
+
#@return [Boolean]
|
94
|
+
def various?
|
95
|
+
joined_names = "#{name} #{appears_as}".downcase
|
96
|
+
|
97
|
+
various_variations = ["vario", "v???????????????rio", "v.a", "vaious", "varios" "vaious", "varoius", "variuos", \
|
98
|
+
"soundtrack", "karaoke", "original cast", "diverse artist"]
|
99
|
+
various_variations.each{|various_variation| return true if joined_names.include?(various_variation)}
|
100
|
+
return false
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
end
|
105
105
|
end
|
@@ -1,16 +1,16 @@
|
|
1
|
-
module Sevendigital
|
2
|
-
|
3
|
-
class Basket < SevendigitalObject
|
4
|
-
attr_accessor :id, :basket_items
|
5
|
-
|
6
|
-
def add_item(release_id, track_id=nil, options={})
|
7
|
-
@basket_items = @api_client.basket.add_item(id, release_id, track_id, options).basket_items
|
8
|
-
end
|
9
|
-
|
10
|
-
def remove_item(item_id, options={})
|
11
|
-
@basket_items = @api_client.basket.remove_item(id, item_id, options).basket_items
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
|
1
|
+
module Sevendigital
|
2
|
+
|
3
|
+
class Basket < SevendigitalObject
|
4
|
+
attr_accessor :id, :basket_items
|
5
|
+
|
6
|
+
def add_item(release_id, track_id=nil, options={})
|
7
|
+
@basket_items = @api_client.basket.add_item(id, release_id, track_id, options).basket_items
|
8
|
+
end
|
9
|
+
|
10
|
+
def remove_item(item_id, options={})
|
11
|
+
@basket_items = @api_client.basket.remove_item(id, item_id, options).basket_items
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
16
|
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
module Sevendigital
|
2
|
-
|
3
|
-
class BasketItem < SevendigitalObject
|
4
|
-
|
5
|
-
attr_accessor :id
|
6
|
-
|
7
|
-
sevendigital_basic_property :type, :artist_name, :item_name, :price, :track_id, :release_id
|
8
|
-
|
9
|
-
sevendigital_extended_property :artist
|
10
|
-
sevendigital_extended_property :release
|
11
|
-
sevendigital_extended_property :track
|
12
|
-
|
13
|
-
end
|
14
|
-
|
1
|
+
module Sevendigital
|
2
|
+
|
3
|
+
class BasketItem < SevendigitalObject
|
4
|
+
|
5
|
+
attr_accessor :id
|
6
|
+
|
7
|
+
sevendigital_basic_property :type, :artist_name, :item_name, :price, :track_id, :release_id
|
8
|
+
|
9
|
+
sevendigital_extended_property :artist
|
10
|
+
sevendigital_extended_property :release
|
11
|
+
sevendigital_extended_property :track
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
15
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sevendigital
|
2
|
-
|
3
|
-
class Card < SevendigitalObject
|
4
|
-
|
5
|
-
attr_accessor :id, :type, :last_4_digits, :card_holder_name, :expiry_date
|
6
|
-
|
7
|
-
# sevendigital_basic_property
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
|
1
|
+
module Sevendigital
|
2
|
+
|
3
|
+
class Card < SevendigitalObject
|
4
|
+
|
5
|
+
attr_accessor :id, :type, :last_4_digits, :card_holder_name, :expiry_date
|
6
|
+
|
7
|
+
# sevendigital_basic_property
|
8
|
+
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
12
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
module Sevendigital
|
2
|
-
|
3
|
-
class ChartItem < SevendigitalObject
|
4
|
-
|
5
|
-
attr_accessor :position, :change, :item
|
6
|
-
|
7
|
-
end
|
8
|
-
|
9
|
-
end
|
1
|
+
module Sevendigital
|
2
|
+
|
3
|
+
class ChartItem < SevendigitalObject
|
4
|
+
|
5
|
+
attr_accessor :position, :change, :item
|
6
|
+
|
7
|
+
end
|
8
|
+
|
9
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module Sevendigital
|
2
|
-
|
3
|
-
class DownloadUrl
|
4
|
-
attr_accessor :url, :format
|
5
|
-
end
|
6
|
-
|
7
|
-
end
|
1
|
+
module Sevendigital
|
2
|
+
|
3
|
+
class DownloadUrl
|
4
|
+
attr_accessor :url, :format
|
5
|
+
end
|
6
|
+
|
7
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module Sevendigital
|
2
|
-
|
3
|
-
class Format
|
4
|
-
attr_accessor :id, :file_format, :bit_rate, :drm_free
|
5
|
-
end
|
6
|
-
|
7
|
-
end
|
1
|
+
module Sevendigital
|
2
|
+
|
3
|
+
class Format
|
4
|
+
attr_accessor :id, :file_format, :bit_rate, :drm_free
|
5
|
+
end
|
6
|
+
|
7
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module Sevendigital
|
2
|
-
|
3
|
-
class Label
|
4
|
-
attr_accessor :id, :name
|
5
|
-
end
|
6
|
-
|
7
|
-
end
|
1
|
+
module Sevendigital
|
2
|
+
|
3
|
+
class Label
|
4
|
+
attr_accessor :id, :name
|
5
|
+
end
|
6
|
+
|
7
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module Sevendigital
|
2
|
-
class List < SevendigitalObject
|
3
|
-
attr_accessor :id, :key, :list_items
|
4
|
-
end
|
1
|
+
module Sevendigital
|
2
|
+
class List < SevendigitalObject
|
3
|
+
attr_accessor :id, :key, :list_items
|
4
|
+
end
|
5
5
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
module Sevendigital
|
2
|
-
|
3
|
-
class ListItem < SevendigitalObject
|
4
|
-
|
5
|
-
attr_accessor :id, :type, :release
|
6
|
-
|
7
|
-
end
|
8
|
-
|
1
|
+
module Sevendigital
|
2
|
+
|
3
|
+
class ListItem < SevendigitalObject
|
4
|
+
|
5
|
+
attr_accessor :id, :type, :release
|
6
|
+
|
7
|
+
end
|
8
|
+
|
9
9
|
end
|