Files
groove-web/protos/library.proto
2024-12-01 03:49:08 +01:00

59 lines
1.2 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);
}
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;
}