2011-04-26 15:43:13 +02:00
|
|
|
/* This file is part of Clementine.
|
|
|
|
Copyright 2011, David Sansome <me@davidsansome.com>
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Note: this file is licensed under the Apache License instead of GPL because
|
|
|
|
// it is used by the Spotify blob which links against libspotify and is not GPL
|
|
|
|
// compatible.
|
|
|
|
|
|
|
|
|
2012-01-08 00:26:27 +01:00
|
|
|
package pb.spotify;
|
2011-04-26 15:42:58 +02:00
|
|
|
|
|
|
|
message LoginRequest {
|
|
|
|
required string username = 1;
|
2011-11-24 12:17:19 +01:00
|
|
|
optional string password = 2;
|
2011-11-27 18:29:33 +01:00
|
|
|
|
|
|
|
optional PlaybackSettings playback_settings = 3;
|
2011-04-26 15:42:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message LoginResponse {
|
2011-08-27 23:01:28 +02:00
|
|
|
enum Error {
|
|
|
|
BadUsernameOrPassword = 1;
|
|
|
|
UserBanned = 2;
|
|
|
|
UserNeedsPremium = 3;
|
|
|
|
Other = 4;
|
2011-11-28 13:32:45 +01:00
|
|
|
ReloginFailed = 5;
|
2011-08-27 23:01:28 +02:00
|
|
|
}
|
|
|
|
|
2011-04-26 15:42:58 +02:00
|
|
|
required bool success = 1;
|
|
|
|
required string error = 2;
|
2011-08-27 23:01:28 +02:00
|
|
|
optional Error error_code = 3 [default = Other];
|
2011-04-26 15:42:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message Playlists {
|
|
|
|
message Playlist {
|
|
|
|
required int32 index = 1;
|
|
|
|
required string name = 2;
|
2011-05-25 16:22:49 +02:00
|
|
|
required bool is_offline = 3;
|
|
|
|
// Offline sync progress between 0-100.
|
|
|
|
optional int32 download_progress = 4;
|
2011-04-26 15:42:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
repeated Playlist playlist = 1;
|
|
|
|
}
|
|
|
|
|
2011-04-26 19:06:36 +02:00
|
|
|
message Track {
|
|
|
|
required bool starred = 1;
|
|
|
|
required string title = 2;
|
|
|
|
repeated string artist = 3;
|
|
|
|
required string album = 4;
|
|
|
|
required int32 duration_msec = 5;
|
|
|
|
required int32 popularity = 6;
|
|
|
|
required int32 disc = 7;
|
|
|
|
required int32 track = 8;
|
|
|
|
required int32 year = 9;
|
|
|
|
required string uri = 10;
|
2011-04-29 15:41:42 +02:00
|
|
|
required string album_art_id = 11;
|
2011-04-26 19:06:36 +02:00
|
|
|
}
|
|
|
|
|
2011-09-18 01:06:07 +02:00
|
|
|
message Album {
|
|
|
|
required Track metadata = 1;
|
|
|
|
repeated Track track = 2;
|
|
|
|
}
|
|
|
|
|
2011-05-25 16:22:49 +02:00
|
|
|
enum PlaylistType {
|
|
|
|
Starred = 1;
|
|
|
|
Inbox = 2;
|
|
|
|
UserPlaylist = 3;
|
|
|
|
}
|
2011-04-26 19:06:36 +02:00
|
|
|
|
2011-05-25 16:22:49 +02:00
|
|
|
message LoadPlaylistRequest {
|
|
|
|
required PlaylistType type = 1;
|
2011-04-26 19:06:36 +02:00
|
|
|
optional int32 user_playlist_index = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message LoadPlaylistResponse {
|
|
|
|
required LoadPlaylistRequest request = 1;
|
|
|
|
repeated Track track = 2;
|
|
|
|
}
|
|
|
|
|
2011-05-25 16:22:49 +02:00
|
|
|
message SyncPlaylistRequest {
|
|
|
|
required LoadPlaylistRequest request = 1;
|
|
|
|
required bool offline_sync = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SyncPlaylistProgress {
|
|
|
|
required LoadPlaylistRequest request = 1;
|
|
|
|
required int32 sync_progress = 2;
|
|
|
|
}
|
|
|
|
|
2011-04-26 19:06:46 +02:00
|
|
|
message PlaybackRequest {
|
|
|
|
required string track_uri = 1;
|
|
|
|
required int32 media_port = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PlaybackError {
|
|
|
|
required string error = 1;
|
|
|
|
}
|
|
|
|
|
2011-04-27 18:38:28 +02:00
|
|
|
message SearchRequest {
|
|
|
|
required string query = 1;
|
|
|
|
optional int32 limit = 2 [default = 250];
|
2011-08-29 03:00:59 +02:00
|
|
|
optional int32 limit_album = 3 [default = 0];
|
2011-04-27 18:38:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message SearchResponse {
|
|
|
|
required SearchRequest request = 1;
|
|
|
|
repeated Track result = 2;
|
|
|
|
optional int32 total_tracks = 3;
|
|
|
|
optional string did_you_mean = 4;
|
|
|
|
optional string error = 5;
|
2011-08-29 03:00:59 +02:00
|
|
|
|
2011-09-18 01:06:07 +02:00
|
|
|
// field 6 is deprecated
|
|
|
|
|
|
|
|
repeated Album album = 7;
|
2011-04-27 18:38:28 +02:00
|
|
|
}
|
|
|
|
|
2011-04-29 15:41:42 +02:00
|
|
|
message ImageRequest {
|
|
|
|
required string id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ImageResponse {
|
|
|
|
required string id = 1;
|
|
|
|
optional bytes data = 2;
|
|
|
|
}
|
|
|
|
|
2011-08-29 04:26:59 +02:00
|
|
|
message BrowseAlbumRequest {
|
|
|
|
required string uri = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message BrowseAlbumResponse {
|
|
|
|
required string uri = 1;
|
|
|
|
repeated Track track = 2;
|
|
|
|
}
|
|
|
|
|
2012-06-12 15:34:23 +02:00
|
|
|
message BrowseToplistRequest {
|
|
|
|
enum ToplistType {
|
|
|
|
Artists = 1;
|
|
|
|
Albums = 2;
|
|
|
|
Tracks = 3;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Region {
|
|
|
|
Everywhere = 1;
|
|
|
|
User = 2;
|
|
|
|
};
|
|
|
|
|
|
|
|
required ToplistType type = 1;
|
|
|
|
optional Region region = 2 [default=Everywhere];
|
|
|
|
// Username to use if region is User.
|
|
|
|
optional string username = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message BrowseToplistResponse {
|
|
|
|
required BrowseToplistRequest request = 1;
|
|
|
|
|
|
|
|
repeated Track track = 2;
|
|
|
|
repeated Album album = 3;
|
|
|
|
}
|
|
|
|
|
2011-09-25 20:24:44 +02:00
|
|
|
message SeekRequest {
|
|
|
|
optional int64 offset_bytes = 1;
|
|
|
|
}
|
|
|
|
|
2014-09-14 02:15:58 +02:00
|
|
|
message SeekCompleted {
|
|
|
|
}
|
|
|
|
|
2011-11-27 18:29:33 +01:00
|
|
|
enum Bitrate {
|
|
|
|
Bitrate96k = 1;
|
|
|
|
Bitrate160k = 2;
|
|
|
|
Bitrate320k = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PlaybackSettings {
|
|
|
|
optional Bitrate bitrate = 1 [default = Bitrate320k];
|
|
|
|
optional bool volume_normalisation = 2 [default = false];
|
|
|
|
}
|
|
|
|
|
2014-09-06 19:21:23 +02:00
|
|
|
message PauseRequest {
|
|
|
|
optional bool paused = 1 [default = false];
|
|
|
|
}
|
|
|
|
|
2014-09-14 02:15:58 +02:00
|
|
|
// NEXT_ID: 23
|
2012-01-08 00:31:20 +01:00
|
|
|
message Message {
|
2012-01-08 00:30:33 +01:00
|
|
|
// Not currently used
|
|
|
|
optional int32 id = 18;
|
|
|
|
|
2011-04-26 15:42:58 +02:00
|
|
|
optional LoginRequest login_request = 1;
|
|
|
|
optional LoginResponse login_response = 2;
|
|
|
|
optional Playlists playlists_updated = 3;
|
2011-04-26 19:06:36 +02:00
|
|
|
optional LoadPlaylistRequest load_playlist_request = 4;
|
|
|
|
optional LoadPlaylistResponse load_playlist_response = 5;
|
2011-04-26 19:06:46 +02:00
|
|
|
optional PlaybackRequest playback_request = 6;
|
|
|
|
optional PlaybackError playback_error = 7;
|
2011-04-27 18:38:28 +02:00
|
|
|
optional SearchRequest search_request = 8;
|
|
|
|
optional SearchResponse search_response = 9;
|
2011-04-29 15:41:42 +02:00
|
|
|
optional ImageRequest image_request = 10;
|
|
|
|
optional ImageResponse image_response = 11;
|
2011-05-25 16:22:49 +02:00
|
|
|
optional SyncPlaylistRequest sync_playlist_request = 12;
|
|
|
|
optional SyncPlaylistProgress sync_playlist_progress = 13;
|
2011-08-29 04:26:59 +02:00
|
|
|
optional BrowseAlbumRequest browse_album_request = 14;
|
|
|
|
optional BrowseAlbumResponse browse_album_response = 15;
|
2011-09-25 20:24:44 +02:00
|
|
|
optional SeekRequest seek_request = 16;
|
2011-11-27 18:29:33 +01:00
|
|
|
optional PlaybackSettings set_playback_settings_request = 17;
|
2012-06-12 15:34:23 +02:00
|
|
|
optional BrowseToplistRequest browse_toplist_request = 19;
|
|
|
|
optional BrowseToplistResponse browse_toplist_response = 20;
|
2014-09-06 19:21:23 +02:00
|
|
|
optional PauseRequest pause_request = 21;
|
2014-09-14 02:15:58 +02:00
|
|
|
optional SeekCompleted seek_completed = 22;
|
2011-04-26 15:42:58 +02:00
|
|
|
}
|