syntax = "proto3";

package music.v1alpha1;

import "metadata/v1alpha1/artist.proto";
import "metadata/v1alpha1/album.proto";
import "metadata/v1alpha1/track.proto";

message ScanRequest {}

message ScanResponse {}

message SearchRequest { string query = 1; }

message SearchResponse {}

message GetAlbumsRequest {
    int32 limit = 1;
    int32 offset = 2;
}

message GetAlbumsResponse { repeated metadata.v1alpha1.Album albums = 1; }

message GetArtistsRequest {
    int32 limit = 1;
    int32 offset = 2;
}

message GetArtistsResponse { repeated metadata.v1alpha1.Artist artists = 1; }

message GetTracksRequest {
    int32 limit = 1;
    int32 offset = 2;
}

message GetTracksResponse { repeated metadata.v1alpha1.Track tracks = 1; }

message GetAlbumDetailsRequest {
    string id = 1;
}

message GetAlbumDetailsResponse { metadata.v1alpha1.Album album = 1; }

message GetArtistDetailsRequest {
    string id = 1;
}

message GetArtistDetailsResponse { metadata.v1alpha1.Artist artist = 1; }

message GetTrackDetailsRequest {
    string id = 1;
}

message GetTrackDetailsResponse { metadata.v1alpha1.Track track = 1; }

service LibraryService {
  rpc Scan(ScanRequest) returns (ScanResponse) {}
  rpc Search(SearchRequest) returns (SearchResponse) {}
  rpc GetAlbums(GetAlbumsRequest) returns (GetAlbumsResponse) {}
  rpc GetAlbumDetails(GetAlbumDetailsRequest)
      returns (GetAlbumDetailsResponse) {}
  rpc GetTracks(GetTracksRequest) returns (GetTracksResponse) {}
  rpc GetTrackDetails(GetTrackDetailsRequest)
      returns (GetTrackDetailsResponse) {}
  rpc GetArtists(GetArtistsRequest) returns (GetArtistsResponse) {}
  rpc GetArtistDetails(GetArtistDetailsRequest)
      returns (GetArtistDetailsResponse) {}
}
