wimp 1.0.0

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.
Files changed (38) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.rspec +5 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +154 -0
  7. data/Rakefile +6 -0
  8. data/lib/gen/README.md +6 -0
  9. data/lib/gen/client_api_login_service.rb +270 -0
  10. data/lib/gen/client_api_service.rb +3016 -0
  11. data/lib/gen/services_constants.rb +13 -0
  12. data/lib/gen/services_types.rb +1035 -0
  13. data/lib/wimp.rb +66 -0
  14. data/lib/wimp/base.rb +30 -0
  15. data/lib/wimp/error.rb +4 -0
  16. data/lib/wimp/playlist.rb +93 -0
  17. data/lib/wimp/simple_artist.rb +10 -0
  18. data/lib/wimp/track.rb +91 -0
  19. data/lib/wimp/version.rb +3 -0
  20. data/resources/skipped-methods.md +44 -0
  21. data/resources/thrift/services.thrift +396 -0
  22. data/spec/fixtures/vcr_cassettes/WiMP_Playlist/should_add_my_track_id.yml +263 -0
  23. data/spec/fixtures/vcr_cassettes/WiMP_Playlist/should_be_able_to_add_tracks_to_playlist.yml +445 -0
  24. data/spec/fixtures/vcr_cassettes/WiMP_Playlist/should_be_able_to_remove_tracks.yml +452 -0
  25. data/spec/fixtures/vcr_cassettes/WiMP_Playlist/should_create_a_playlist.yml +98 -0
  26. data/spec/fixtures/vcr_cassettes/WiMP_Playlist/should_find_by_uuid.yml +49 -0
  27. data/spec/fixtures/vcr_cassettes/WiMP_Playlist/should_not_crash_on_invalid_pos.yml +372 -0
  28. data/spec/fixtures/vcr_cassettes/WiMP_Track/.yml +169 -0
  29. data/spec/fixtures/vcr_cassettes/WiMP_Track/should_be_searchable.yml +169 -0
  30. data/spec/fixtures/vcr_cassettes/WiMP_Track/should_paginate.yml +61 -0
  31. data/spec/fixtures/vcr_cassettes/login/should_raise_error_using_invalid_credentials.yml +47 -0
  32. data/spec/fixtures/vcr_cassettes/login/should_return_sesson_id_on_successfull_login.yml +53 -0
  33. data/spec/login_spec.rb +21 -0
  34. data/spec/playlist_spec.rb +37 -0
  35. data/spec/spec_helper.rb +19 -0
  36. data/spec/track_spec.rb +26 -0
  37. data/wimp.gemspec +30 -0
  38. metadata +207 -0
@@ -0,0 +1,66 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), "gen")
2
+ require "gen/client_api_login_service"
3
+ require "gen/client_api_service"
4
+ require "wimp/version"
5
+ require "wimp/error"
6
+ require "wimp/simple_artist"
7
+ require "wimp/base"
8
+ require "wimp/track"
9
+ require "wimp/playlist"
10
+
11
+ module WiMP
12
+ class << self
13
+ attr_accessor :configuration
14
+ end
15
+
16
+ def self.configure
17
+ yield(configuration)
18
+ end
19
+
20
+ class Configuration
21
+ P_USERNAME = "wimpse"
22
+ P_PASSWORD = "slbh4UUgH"
23
+ D_CLIENT_NAME = "Android_WIMP-2.5.2.se"
24
+ D_CLIENT_ID = "8263371084"
25
+ SECURE_LOGIN_URL = "https://client.wimpmusic.com/clientapi/servicelogin"
26
+
27
+ attr_accessor :username, :password, :client_name, :client_id
28
+
29
+ #
30
+ # @return String
31
+ #
32
+ def session
33
+ @_session ||= begin
34
+ transport = Thrift::HTTPClientTransport.new(SECURE_LOGIN_URL)
35
+ protocol = Thrift::BinaryProtocol.new(transport)
36
+ client = Gen::ClientApiLoginService::Client.new(protocol)
37
+ transport.open
38
+ result = client.simpleLogin(
39
+ username,
40
+ password,
41
+ P_USERNAME,
42
+ P_PASSWORD,
43
+ client_name || D_CLIENT_NAME,
44
+ client_id || D_CLIENT_ID
45
+ )
46
+ transport.close
47
+ result.sessionId
48
+ end
49
+ rescue Thrift::ApplicationException
50
+ raise LoginFailed.new("Login failed, invalid credentials. Are you really a premium user?")
51
+ end
52
+
53
+ #
54
+ # @return Boolean
55
+ #
56
+ def logged_in?
57
+ !! session
58
+ end
59
+
60
+ def logout!
61
+ @_session = nil
62
+ end
63
+ end
64
+
65
+ self.configuration ||= Configuration.new
66
+ end
@@ -0,0 +1,30 @@
1
+ module WiMP
2
+ class Base
3
+ @@transport = Thrift::HTTPClientTransport.new("http://client.wimpmusic.com/clientapi/service")
4
+ @@protocol = Thrift::BinaryProtocol.new(@@transport)
5
+ @@client = Gen::ClientApiService::Client.new(@@protocol)
6
+
7
+ def initialize(orginal)
8
+ @o = orginal
9
+ end
10
+
11
+ def self.execute(&block)
12
+ @@transport.open
13
+ result = block.call(@@client)
14
+ @@transport.close
15
+ result
16
+ end
17
+
18
+ def execute(&block)
19
+ Base.execute(&block)
20
+ end
21
+
22
+ def self.session
23
+ WiMP.configuration.session
24
+ end
25
+
26
+ def session
27
+ WiMP.configuration.session
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,4 @@
1
+ module WiMP
2
+ class LoginFailed < StandardError
3
+ end
4
+ end
@@ -0,0 +1,93 @@
1
+ module WiMP
2
+ class Playlist < Base
3
+ def initialize(oplaylist)
4
+ @o = oplaylist
5
+ @tracks = (@o.tracks || []).map{|track| Track.new(track)}
6
+ end
7
+
8
+ #
9
+ # @title String
10
+ # @return Playlist
11
+ #
12
+ def self.create(title)
13
+ execute do |client|
14
+ new(client.addUserPlaylist(title, session))
15
+ end
16
+ end
17
+
18
+ #
19
+ # @uuid String
20
+ # @return Playlist
21
+ #
22
+ def self.find(uuid)
23
+ execute do |client|
24
+ new(client.getUserPlaylistByUuid(uuid, session))
25
+ end
26
+ end
27
+
28
+ #
29
+ # @tracks Array<Track> Tracks to be added
30
+ # @options[start_position] Integer Where
31
+ # should the new tracks be added?
32
+ # @return Boolean Were the request sucessful?
33
+ #
34
+ def add_tracks(tracks, options = {})
35
+ add_tracks_by_id(tracks.map(&:id), options)
36
+ end
37
+
38
+ #
39
+ # @tracks Array<Integer> A list of Track#id
40
+ # @options[start_position] Integer Where
41
+ # should the new tracks be added?
42
+ # @return Boolean Were the request sucessful?
43
+ #
44
+ def add_tracks_by_id(track_ids, options = {})
45
+ execute do |client|
46
+ client.addTracksToUserPlaylist(
47
+ uuid,
48
+ track_ids,
49
+ options.fetch(:start_position, 0),
50
+ session
51
+ )
52
+ end
53
+ end
54
+
55
+ #
56
+ # @indices Array<Integer> Track positions
57
+ # @return Boolean Were the request successfull?
58
+ #
59
+ def remove_tracks_by_indices(indices)
60
+ execute do |client|
61
+ client.removeUserPlaylistTracks(uuid, indices, session)
62
+ end
63
+ end
64
+
65
+ #
66
+ # @return String
67
+ #
68
+ def url
69
+ "http://wimpmusic.se/playlist/#{uuid}"
70
+ end
71
+
72
+ #
73
+ # @return String
74
+ #
75
+ def uuid
76
+ @o.uuid
77
+ end
78
+
79
+ #
80
+ # @return Array<Track>
81
+ #
82
+ def tracks
83
+ @tracks
84
+ end
85
+
86
+ #
87
+ # @return Integer
88
+ #
89
+ def count
90
+ @o.count
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,10 @@
1
+ module WiMP
2
+ class SimpleArtist < Struct.new(:name, :id)
3
+ #
4
+ # @return String
5
+ #
6
+ def url
7
+ "http://wimpmusic.se/artist/#{id}"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,91 @@
1
+ require "time"
2
+
3
+ module WiMP
4
+ class Track < Base
5
+ #
6
+ # @query String
7
+ # @options[limit] Integer
8
+ #
9
+ # @return Array<Track>
10
+ #
11
+ def self.search(query, options = {})
12
+ execute do |client|
13
+ client.search(
14
+ query, 0, 0,
15
+ options.fetch(:limit, 10),
16
+ WiMP.configuration.session, 0
17
+ ).tracks.map {|track| WiMP::Track.new(track)}
18
+ end
19
+ end
20
+
21
+ #
22
+ # @return String
23
+ #
24
+ def url
25
+ "http://wimpmusic.se/track/#{id}"
26
+ end
27
+
28
+ #
29
+ # @return Integer
30
+ #
31
+ def popularity
32
+ @o.popularity
33
+ end
34
+
35
+ #
36
+ # @return Integer
37
+ #
38
+ def id
39
+ @o.id
40
+ end
41
+
42
+ #
43
+ # @return Integer
44
+ #
45
+ def duration
46
+ @o.duration
47
+ end
48
+
49
+ #
50
+ # @return Integer
51
+ #
52
+ def album_id
53
+ @o.albumId
54
+ end
55
+
56
+ #
57
+ # @return Integer
58
+ #
59
+ def artist_id
60
+ @o.artistId
61
+ end
62
+
63
+ #
64
+ # @return String
65
+ #
66
+ def album
67
+ @o.album
68
+ end
69
+
70
+ #
71
+ # @return String
72
+ #
73
+ def artist
74
+ @o.artist
75
+ end
76
+
77
+ #
78
+ # @return String
79
+ #
80
+ def title
81
+ @o.title
82
+ end
83
+
84
+ #
85
+ # @return SimpleArtist
86
+ #
87
+ def artist
88
+ @_artist ||= SimpleArtist.new(@o.artist, artist_id)
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,3 @@
1
+ module Wimp
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,44 @@
1
+ - ignored methods
2
+ - getClientMessage
3
+ - getLoginClientMessage
4
+ - getNotification
5
+ - getOfflineContent
6
+ - getOfflineContentClients
7
+ - getPromotionElementsByGroup
8
+ - getRefreshedProfileForSession
9
+ - getStream
10
+ - getTrackURLForOffline
11
+ - getTrackURLForStreaming
12
+ - getUserPlaylistByUuidIfNewer
13
+ - getUserWimpClientAuthorizedForOfflineContentByProfileId
14
+ - hasStreamingPrivileges
15
+ - isClientAuthorizedForOfflineContent
16
+ - loginWithFacebookOAuth
17
+ - loginWithSPIDOAuth
18
+ - loginWithToken
19
+ - logout
20
+ - moveUserPlaylistTracksWithTs
21
+ - recoverPassword
22
+ - removeAlbumFromFavorites
23
+ - removeAlbumFromOffline
24
+ - removeAllFromOffline
25
+ - removeArtistFromFavorites
26
+ - removeFriend
27
+ - removePlaylistFromFavorites
28
+ - removePlaylistFromOffline
29
+ - removeTrackFromFavorites
30
+ - removeUserPlaylistTracksWithTs
31
+ - renameUserPlaylistByUuidWithTs
32
+ - reportPlay
33
+ - searchForTrackFromGraceNoteInfo
34
+ - setAlbumAsOffline
35
+ - setFacebookFriends
36
+ - setFacebookScrobblingEnabled
37
+ - setFacebookUid
38
+ - setPlaylistAsOffline
39
+ - setPrivateSessionEnabled
40
+ - setProfileLibrarySharingLevels
41
+ - setPushToken
42
+ - simpleReportOfflinePlays
43
+ - takeStreamingPrivileges
44
+ - addTracksToUserPlaylistWithTs
@@ -0,0 +1,396 @@
1
+ namespace rb WiMP.Gen
2
+
3
+ enum AlbumOrderBy {
4
+ POPULARITY = 1,
5
+ POPULARITY_THIS_WEEK = 2,
6
+ ALBUM_NAME = 3,
7
+ ARTIST_NAME = 4,
8
+ RELEASE_DATE = 5
9
+ }
10
+
11
+ enum PlaylistType {
12
+ PRIVATE = 1,
13
+ EDITORIAL = 2,
14
+ ARTIST = 3,
15
+ USER = 4,
16
+ RADIO = 5
17
+ }
18
+
19
+ enum PrivacyLevel {
20
+ ALL = 1,
21
+ PUBLIC = 2,
22
+ FRIENDS = 3
23
+ }
24
+
25
+ enum FavoriteOrderBy {
26
+ NAME = 1,
27
+ ARTIST_NAME = 2,
28
+ DATE_ADDED = 3,
29
+ INDEX = 4
30
+ }
31
+
32
+ enum AlbumFilter {
33
+ ALL = 1,
34
+ ALLBUTSINGLES = 2,
35
+ ONLYEPS = 3,
36
+ ONLYSINGLES = 4,
37
+ ONLYALBUMS = 5,
38
+ ALLBUTALBUMS = 6,
39
+ ONLYOWNALBUMS = 7,
40
+ ALLBUTOWN = 8,
41
+ ONLYOWNSINGLESANDEPS = 9
42
+ }
43
+
44
+ struct Profile {
45
+ 1: required i32 profileId;
46
+ 2: required i32 userId;
47
+ 3: optional string phoneNumber;
48
+ 4: required i64 registrationDate;
49
+ 5: required string sessionId;
50
+ 6: optional string mobileOperator;
51
+ 7: required string subscriptionStatus;
52
+ 8: required i32 channelId;
53
+ 9: required bool clientAuthorizedForOfflineContent;
54
+ 10: required bool validForStreaming;
55
+ 11: required i64 subscriptionEndDate;
56
+ 12: required i32 playListSharingLevel;
57
+ 13: required i32 artistSharingLevel;
58
+ 14: required i32 trackSharingLevel;
59
+ 15: required i32 albumSharingLevel;
60
+ 16: required string username;
61
+ 17: required i64 allowOfflineUntil;
62
+ 18: required i32 registrationType;
63
+ 19: required i64 facebookUid;
64
+ 20: required string subscriptionType;
65
+ 21: required bool hasPremiumAccess;
66
+ 22: required bool enableFacebookScrobbling;
67
+ 23: required i32 highestAudioEncoding;
68
+ 24: required i64 lastUpdatedFavArtist;
69
+ 25: required i64 lastUpdatedFavTrack;
70
+ 26: required i64 lastUpdatedFavAlbum;
71
+ 27: required i64 lastUpdatedFavPlaylist;
72
+ 28: required i64 lastUpdatedLibraryPlaylists;
73
+ 29: required i32 partnerId;
74
+ }
75
+
76
+ struct Artist {
77
+ 1: required string artistName;
78
+ 2: required string artistBio;
79
+ 3: required i32 artistId;
80
+ 4: optional string info;
81
+ 5: optional string link;
82
+ }
83
+
84
+ struct RecordLabel {
85
+ 1: required string recordLabelName;
86
+ 2: required i32 recordLabelId;
87
+ 3: required string recordProvider;
88
+ 4: required i32 recordProviderId;
89
+ 5: required string recordSubLabel;
90
+ 6: required i32 recordSubLabelId;
91
+ }
92
+
93
+ struct Track {
94
+ 1: required string title;
95
+ 2: required string artist;
96
+ 3: required i32 artistId;
97
+ 4: required i32 albumId;
98
+ 5: required string album;
99
+ 6: optional string copyright;
100
+ 7: required i32 duration;
101
+ 8: optional string smallAlbumCover;
102
+ 9: optional string mediumAlbumCover;
103
+ 10: optional string largeAlbumCover;
104
+ 11: required i32 id;
105
+ 12: optional string contentAccessString;
106
+ 13: required i32 volumeNumber;
107
+ 14: optional i32 trackNumber;
108
+ 15: optional string version;
109
+ 16: required i64 salesStartDate;
110
+ 17: required bool salesReady;
111
+ 18: required bool streamReady;
112
+ 19: required double price;
113
+ 20: optional string currencyCode;
114
+ 21: required bool albumOnly;
115
+ 22: required bool albumBroken;
116
+ 23: optional string priceCode;
117
+ 24: required string albumCalculatedType;
118
+ 25: required bool allowStreaming;
119
+ 26: required i32 albumNrOfVolumes;
120
+ 27: required i32 popularity;
121
+ 28: required i32 popularityThisWeek;
122
+ 29: required double searchScore;
123
+ 30: required RecordLabel recordLabel;
124
+ 31: required i32 salesPriceRuleId;
125
+ 32: required i64 streamStartDate;
126
+ 33: required string previewURL;
127
+ 34: optional string customizableAlbumCover;
128
+ 35: required bool premiumOnlyStreaming;
129
+ 36: required i32 popularityLevel;
130
+ 37: required string revisedCopyright;
131
+ }
132
+
133
+ struct Album {
134
+ 1: required i32 id;
135
+ 2: required bool allowStreaming;
136
+ 3: required string artist;
137
+ 4: required i32 artistId;
138
+ 5: required string calculatedType;
139
+ 6: required string copyright;
140
+ 7: required i32 duration;
141
+ 8: required string genre;
142
+ 9: optional string largeAlbumCover;
143
+ 10: required i32 numberOfTracks;
144
+ 11: required i32 numberOfVolumes;
145
+ 12: required bool partialData;
146
+ 13: required i32 partialNrOfTracks;
147
+ 14: required RecordLabel recordLabel;
148
+ 15: required i64 salesStartDate;
149
+ 16: required bool streamReady;
150
+ 17: required string title;
151
+ 18: optional string version;
152
+ 19: optional string currencyCode;
153
+ 20: optional string desc;
154
+ 21: optional string details;
155
+ 22: optional string mediumAlbumCover;
156
+ 23: optional string smallAlbumCover;
157
+ 24: required i32 popularity;
158
+ 25: required i32 popularityThisWeek;
159
+ 26: required double price;
160
+ 27: required string priceCode;
161
+ 28: required i64 releaseDate;
162
+ 29: required string releaseYear;
163
+ 30: required i32 salesPriceRuleId;
164
+ 31: required bool salesReady;
165
+ 32: required double searchScore;
166
+ 33: required string trackBundleType;
167
+ 34: required bool trackOnly;
168
+ 35: required i64 streamStartDate;
169
+ 36: optional string customizableAlbumCover;
170
+ 37: optional string bookletURL;
171
+ 38: required bool premiumOnlyStreaming;
172
+ 39: required string revisedCopyright;
173
+ }
174
+
175
+ struct Playlist {
176
+ 1: required i32 count;
177
+ 2: required i32 createdByArtistId;
178
+ 3: required i32 duration;
179
+ 4: optional string imgPath;
180
+ 5: required i64 lastUpdated;
181
+ 6: required string playlistName;
182
+ 7: required i32 profileId;
183
+ 8: required i64 registeredDate;
184
+ 9: optional list<Track> tracks;
185
+ 10: required string uuid;
186
+ 11: optional i32 type;
187
+ 12: optional string desc;
188
+ 13: required i32 id;
189
+ 14: optional string createdByNickName;
190
+ }
191
+
192
+ struct SearchResult {
193
+ 1: optional list<Artist> artists;
194
+ 2: optional list<Track> tracks;
195
+ 3: optional list<Album> albums;
196
+ 4: optional list<Playlist> playlist;
197
+ }
198
+
199
+ struct AlbumReview {
200
+ 1: required string review;
201
+ 2: required string summary;
202
+ 3: required string sourceName;
203
+ }
204
+
205
+ struct SimilarAlbum {
206
+ 1: required i32 albumId;
207
+ 2: required string title;
208
+ 3: required string artistName;
209
+ 4: required i32 artistId;
210
+ }
211
+
212
+ struct SimilarAlbumList {
213
+ 1: required list<SimilarAlbum> similarAlbums;
214
+ 2: required string sourceName;
215
+ }
216
+
217
+ struct AlbumMetadata {
218
+ 1: required i32 albumId;
219
+ 2: required string title;
220
+ 3: required i32 artistId;
221
+ 4: required AlbumReview albumReview;
222
+ 5: required SimilarAlbumList similarAlbumList;
223
+ }
224
+
225
+ struct SimilarArtist {
226
+ 1: required i32 artistId;
227
+ 2: required string artistName;
228
+ }
229
+
230
+ struct SimilarArtistList {
231
+ 1: required list<SimilarArtist> similarArtistList;
232
+ 2: required string sourceName;
233
+ }
234
+
235
+ struct RelatedArtist {
236
+ 1: required i32 artistId;
237
+ 2: required string artistName;
238
+ 3: required i32 relationType;
239
+ }
240
+
241
+ struct RelatedArtistList {
242
+ 1: required list<RelatedArtist> relatedArtistList;
243
+ 2: required string sourceName;
244
+ }
245
+
246
+ struct ArtistLink {
247
+ 1: required string url;
248
+ }
249
+
250
+ struct ArtistLinkList {
251
+ 1: required list<ArtistLink> artistLinks;
252
+ 2: required string sourceName;
253
+ }
254
+
255
+ struct ArtistBiography {
256
+ 1: required string biographySummary;
257
+ 2: required string biography;
258
+ 3: required string sourceName;
259
+ }
260
+
261
+ struct ArtistMetaData {
262
+ 1: required i32 artistId;
263
+ 2: required string artistName;
264
+ 3: required ArtistBiography artistBiography;
265
+ 4: required SimilarArtistList similarArtists;
266
+ 5: required RelatedArtistList relatedArtists;
267
+ 6: required ArtistLinkList artistLinks;
268
+ }
269
+
270
+ struct Category {
271
+ 1: required i32 id;
272
+ 2: optional string name;
273
+ 8: required i64 lastUpdated;
274
+ 9: required i32 contentType;
275
+ 10: optional string desc;
276
+ 11: required bool hasProductDescriptions;
277
+ 12: optional string imageURL;
278
+ }
279
+
280
+ struct CategoryTree {
281
+ 1: optional Category category;
282
+ 2: optional map<i32, list<Category>> children;
283
+ }
284
+
285
+ struct FavoriteAlbum {
286
+ 1: optional i32 dateAdded;
287
+ 2: required Album album;
288
+ 3: required i32 profileId;
289
+ }
290
+
291
+ struct FavoriteArtist {
292
+ 1: required i64 dateAdded;
293
+ 2: required Artist artist;
294
+ 3: required list<Album> albums;
295
+ 4: required i32 profileId;
296
+ }
297
+
298
+ struct FavoritePlaylist {
299
+ 1: required i64 dateAdded;
300
+ 2: required Playlist playlist;
301
+ 3: required i32 profileId;
302
+ }
303
+
304
+ struct FavoriteTrack {
305
+ 1: required i64 dateAdded;
306
+ 2: required Track track;
307
+ 3: required i32 profileId;
308
+ }
309
+
310
+ struct WallPost {
311
+ 1: required i32 id;
312
+ 2: required i32 profileId;
313
+ 3: required i64 postDate;
314
+ 4: required i32 action;
315
+ 5: required string artifactId;
316
+ 6: required string artifactTitle;
317
+ 7: optional string artifactParentTitle;
318
+ }
319
+
320
+ struct Friend {
321
+ 1: required i32 id;
322
+ 2: required i64 lastUpdatedFavourites;
323
+ 3: required i64 facebookUid;
324
+ 4: required i64 madeFriendDate;
325
+ 5: required i64 lastVisitedFriendDate;
326
+ 6: required bool blocked;
327
+ 7: required string friendType;
328
+ 8: required string nick;
329
+ 9: required i32 friendProfileId;
330
+ 10: required i32 nrOfSharedAlbums;
331
+ 11: required i32 nrOfSharedTracks;
332
+ 12: required i32 nrOfSharedPlayLists;
333
+ 13: required i32 nrOfSharedArtists;
334
+ }
335
+
336
+ service ClientApiLoginService {
337
+ map<string, string> getClientConfig(1:string partnerUsername, 2:string partnerPassword, 3:string clientName);
338
+ Profile simpleLogin(1:string userName, 2:string password, 3:string partnerUsername, 4:string partnerPassword, 5:string clientName, 6:string clientUniqueKey);
339
+ Profile recoverPassword(1:string userName, 2:string partnerUsername, 3:string partnerPassword);
340
+ Profile loginWithToken(1:string userName, 2:string password, 3:string partnerUsername, 4:string partnerPassword, 5:string clientName);
341
+ }
342
+
343
+ service ClientApiService {
344
+ SearchResult search(1:string term, 2:i32 limitArtists, 3:i32 limitAlbums, 4:i32 limitTracks, 5:string sessionId, 6:i32 limitPlaylists);
345
+ oneway void addAlbumToFavorites(1:i32 albumId, 2:string sessionId);
346
+ oneway void addArtistToFavorites(1:i32 artistId, 2:string sessionId);
347
+ oneway void addFriend(1:i32 userId, 2:string sessionId);
348
+ oneway void addPlaylistToFavorites(1:string playlistUUID, 2:string sessionId);
349
+ oneway void addTrackToFavorites(1:i32 trackId, 2:string sessionId);
350
+ bool addTracksToUserPlaylist(1:string playlistUUID, 2:list<i32> tracks, 3:i32 position, 4:string sessionId);
351
+ Playlist addUserPlaylist(1:string title, 2:string sessionId);
352
+ Album getAlbumById(1:i32 albumId, 2:string sessionId);
353
+ AlbumMetadata getAlbumMetaData(1:i32 albumId, 2:string sessionId);
354
+ list<Album> getAlbumsByArtistId(1:i32 artistId, 2:i32 limit, 3:AlbumOrderBy order, 4:string sessionId, 5:AlbumFilter filter);
355
+ list<Album> getAlbumsByArtistIdWithPaging(1:i32 artistId, 2:i32 startIndex, 3:i32 limit, 4:bool includeSingles, 5:AlbumOrderBy order, 6:string sessionId);
356
+ list<Album> getAlbumsByCategoryId(1:i32 categoryId, 2:i32 startIndex, 3:i32 limit, 4:string sessionId);
357
+ list<Album> getAlbumsByIds(1:list<i32> albumIds, 2:string sessionId);
358
+ list<Playlist> getAllUserPlaylists(1:string sessionId);
359
+ Artist getArtistById(1:i32 artistId, 2:string sessionId);
360
+ ArtistMetaData getArtistMetaData(1:i32 artistId, 2:string sessionId);
361
+ string getBookletURL(1:i32 albumId, 2:string sessionId);
362
+ list<Category> getCategories(1:i32 categoryId, 2:string sessionId, 3:i32 startIndex, 4:i32 limit);
363
+ CategoryTree getCategoryAndSubCategories(1:i32 categoryId, 2:i32 depth, 3:string sessionId);
364
+ Category getCategoryById(1:i32 categoryId, 2:string sessionId);
365
+ list<FavoriteAlbum> getFavoriteAlbums(1:FavoriteOrderBy order, 2:string sessionId);
366
+ list<FavoriteAlbum> getFavoriteAlbumsByProfileId(1:i32 profileId, 2:PrivacyLevel paramPrivacyLevel, 3:FavoriteOrderBy order, 4:string sessionId);
367
+ list<FavoriteArtist> getFavoriteArtists(1:FavoriteOrderBy order, 2:string sessionId);
368
+ list<FavoriteArtist> getFavoriteArtistsByProfileId(1:i32 profileId, 2:PrivacyLevel paramPrivacyLevel, 3:FavoriteOrderBy order, 4:string sessionId);
369
+ list<FavoritePlaylist> getFavoritePlaylists(1:FavoriteOrderBy order, 2:string sessionId);
370
+ list<FavoritePlaylist> getFavoritePlaylistsByProfileId(1:i32 profileId, 2:PrivacyLevel paramPrivacyLevel, 3:FavoriteOrderBy order, 4:string sessonId);
371
+ list<FavoriteTrack> getFavoriteTracks(1:FavoriteOrderBy order, 2:string sessonId);
372
+ list<FavoriteTrack> getFavoriteTracksByProfileId(1:i32 profileId, 2:PrivacyLevel paramPrivacyLevel, 3:FavoriteOrderBy order, 4:string sessonId);
373
+ list<WallPost> getWallPosts(1:i32 profileId, 2:i32 startIndex, 3:i32 offset, 4:string sessonId);
374
+ list<Friend> getFriends(1:string sessonId);
375
+ i64 getLastUpdatedFavAlbum(1:string sessonId);
376
+ i64 getLastUpdatedFavArtist(1:string sessonId);
377
+ i64 getLastUpdatedFavPlaylist(1:string sessonId);
378
+ i64 getLastUpdatedFavTrack(1:string sessonId);
379
+ i64 getLastUpdatedPlaylist(1:string sessonId);
380
+ list<Playlist> getPlaylistsByCategoryId(1:i32 categoryId, 2:i32 startIndex, 3:i32 limit, 4:string sessonId);
381
+ list<Playlist> getProfileTrackPlayListsByArtistId(1:i32 artistId, 2:i32 startIndex, 3:i32 limit, 4:string sessonId);
382
+ list<Playlist> getProfileTrackPlayListsInclidingArtistId(1:i32 artistId, 2:i32 startIndex, 3:i32 limit, 4:string sessonId);
383
+ list<Track> getTopTracksByArtistId(1:i32 artistId, 2:i32 limit, 3:bool onlyAsMainArtist, 4:string sessonId);
384
+ Track getTrackById(1:i32 trackId, 2:string sessonId);
385
+ list<Track> getTracksByAlbumId(1:i32 albumId, 2:string sessonId);
386
+ list<Track> getTracksByCategoryId(1:i32 categoryId, 2:i32 startIndex, 3:i32 limit, 4:string sessonId);
387
+ Playlist getUserPlaylistByUuid(1:string uuid, 2:string sessonId);
388
+ list<Playlist> getUserPlaylistsByType(1:PlaylistType type, 2:i32 startIndex, 3:i32 limit, 4:string sessonId)
389
+ list<Playlist> getUserPlaylistsByUuids(1:list<string> uuids, 2:string sessonId)
390
+ bool moveUserPlaylistTracks(1:string uuid, 2:list<i32> fromIndex, 3:i32 toIndex, 4:string sessonId);
391
+ bool removeUserPlaylistByUuid(1:string uuid, 2:string sessonId);
392
+ bool removeUserPlaylistTracks(1:string uuid, 2:list<i32> indices, 3:string sessonId);
393
+ bool renameUserPlaylistByUuid(1:string uuid, 2:string title, 3:string sessonId);
394
+ list<Track> suggestTracksByArtistIds(1:list<i32> artistIds, 2:i32 limit, 3:string sessonId);
395
+ list<Track> suggestTracksByTrackIds(1:list<i32> trackIds, 2:i32 limit, 3:string sessonId);
396
+ }