66 lines
1.4 KiB
Protocol Buffer
66 lines
1.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
import 'google/protobuf/empty.proto';
|
|
|
|
package library;
|
|
|
|
service Library {
|
|
rpc ListTracks(google.protobuf.Empty) returns (TrackList);
|
|
rpc ListPlaylists(google.protobuf.Empty) returns (ListPlaylistsResponse);
|
|
rpc CreatePlaylist(CreatePlaylistRequest) returns (CreatePlaylistResponse);
|
|
rpc DeletePlaylist(DeletePlaylistRequest) returns (google.protobuf.Empty);
|
|
rpc AddTrackToPlaylist(AddTrackToPlaylistRequest) returns (google.protobuf.Empty);
|
|
rpc RemoveTrackFromPlaylist(RemoveTrackFromPlaylistRequest) returns (google.protobuf.Empty);
|
|
rpc SwapTracks(SwapTracksRequest) returns (TrackList);
|
|
}
|
|
|
|
message TrackList {
|
|
repeated Track tracks = 1;
|
|
}
|
|
|
|
message Track {
|
|
string hash = 1;
|
|
string name = 2;
|
|
string artist_name = 3;
|
|
uint64 artist_id = 4;
|
|
uint64 duration = 5;
|
|
}
|
|
|
|
message Playlist {
|
|
uint32 id = 1;
|
|
string name = 2;
|
|
repeated Track tracks = 3;
|
|
}
|
|
|
|
message ListPlaylistsResponse {
|
|
repeated Playlist playlists = 1;
|
|
}
|
|
|
|
message CreatePlaylistRequest {
|
|
string name = 1;
|
|
}
|
|
|
|
message CreatePlaylistResponse {
|
|
Playlist playlist = 1;
|
|
}
|
|
|
|
message DeletePlaylistRequest {
|
|
uint32 id = 1;
|
|
}
|
|
|
|
message AddTrackToPlaylistRequest {
|
|
uint32 playlist_id = 1;
|
|
string track_hash = 2;
|
|
}
|
|
|
|
message RemoveTrackFromPlaylistRequest {
|
|
uint32 playlist_id = 1;
|
|
uint32 track_rank = 2;
|
|
}
|
|
|
|
message SwapTracksRequest {
|
|
uint32 playlist_id = 1;
|
|
uint32 a_rank = 2;
|
|
uint32 b_rank = 3;
|
|
}
|