196 lines
4.0 KiB
Protocol Buffer
196 lines
4.0 KiB
Protocol Buffer
/*
|
|
* Copyright (C) 2013 Emeric Poupon
|
|
*
|
|
* This file is part of LMS.
|
|
*
|
|
* LMS is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* LMS is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
package LmsAPI;
|
|
|
|
message AudioCollectionRequest
|
|
{
|
|
|
|
message SearchFilter
|
|
{
|
|
repeated uint64 artist_id = 1; // has one of these artists
|
|
repeated uint64 genre_id = 2; // has one of these genres
|
|
repeated uint64 release_id = 3; // hase one of these releases
|
|
repeated uint64 track_id = 4; // has one of theses tracks
|
|
}
|
|
|
|
message BatchParameter
|
|
{
|
|
required uint32 offset = 1; // First element requested
|
|
required uint32 size = 2; // Number of elements requested. Server may not honor this size if too big
|
|
}
|
|
|
|
message GetGenreList
|
|
{
|
|
required BatchParameter batch_parameter = 1;
|
|
optional SearchFilter search_filter = 2;
|
|
}
|
|
|
|
message GetArtistList
|
|
{
|
|
required BatchParameter batch_parameter = 1;
|
|
optional SearchFilter search_filter = 2;
|
|
}
|
|
|
|
message GetReleaseList
|
|
{
|
|
required BatchParameter batch_parameter = 1;
|
|
optional SearchFilter search_filter = 2;
|
|
}
|
|
|
|
message GetTrackList
|
|
{
|
|
required BatchParameter batch_parameter = 1;
|
|
optional SearchFilter search_filter = 2;
|
|
}
|
|
|
|
message GetCoverArt
|
|
{
|
|
enum Type
|
|
{
|
|
TypeGetCoverArtRelease = 1;
|
|
TypeGetCoverArtTrack = 2;
|
|
}
|
|
|
|
required Type type = 1;
|
|
|
|
optional uint64 release_id = 2; // Release that owns the cover art
|
|
optional uint64 track_id = 3; // Track that owns the cover art
|
|
|
|
required uint32 size = 4; // Scale image to size*size pixels. Set 0 to get the biggest image
|
|
}
|
|
|
|
enum Type
|
|
{
|
|
TypeGetRevision = 1;
|
|
TypeGetGenreList = 2;
|
|
TypeGetArtistList = 3;
|
|
TypeGetReleaseList = 4;
|
|
TypeGetTrackList = 5;
|
|
TypeGetCoverArt = 6;
|
|
}
|
|
|
|
required Type type = 1;
|
|
|
|
optional GetGenreList get_genres = 3;
|
|
optional GetArtistList get_artists = 4;
|
|
optional GetReleaseList get_releases = 5;
|
|
optional GetTrackList get_tracks = 6;
|
|
optional GetCoverArt get_cover_art = 7;
|
|
}
|
|
|
|
|
|
message AudioCollectionResponse
|
|
{
|
|
|
|
message Revision
|
|
{
|
|
required string rev = 1; // Unique identifier of the database revision
|
|
}
|
|
|
|
message GenreList
|
|
{
|
|
repeated Genre genres = 1;
|
|
}
|
|
|
|
message ArtistList
|
|
{
|
|
repeated Artist artists = 1;
|
|
}
|
|
|
|
message ReleaseList
|
|
{
|
|
repeated Release releases = 1;
|
|
}
|
|
|
|
message TrackList
|
|
{
|
|
repeated Track tracks = 1;
|
|
}
|
|
|
|
message CoverArt
|
|
{
|
|
optional string mime_type = 1;
|
|
required bytes data = 2;
|
|
}
|
|
|
|
message Genre
|
|
{
|
|
required uint64 id = 1;
|
|
optional string mbid = 2;
|
|
required string name = 3;
|
|
}
|
|
|
|
message Artist
|
|
{
|
|
required uint64 id = 1;
|
|
optional string mbid = 2;
|
|
required string name = 3;
|
|
}
|
|
|
|
message Release
|
|
{
|
|
required uint64 id = 1;
|
|
optional string mbid = 2;
|
|
required string name = 3;
|
|
}
|
|
|
|
message Track
|
|
{
|
|
required uint64 id = 1; // Track id
|
|
optional string mbid = 2;
|
|
|
|
required uint64 artist_id = 3;
|
|
required uint64 release_id = 4;
|
|
repeated uint64 genre_id = 5;
|
|
|
|
optional string artist_mbid = 6;
|
|
optional string release_mbid = 7;
|
|
optional uint32 disc_number = 8;
|
|
optional uint32 track_number = 9;
|
|
required string name = 10;
|
|
required uint32 duration_secs = 11;
|
|
optional string release_date = 12;
|
|
optional string original_release_date = 13;
|
|
}
|
|
|
|
enum Type {
|
|
TypeRevision = 1;
|
|
TypeGenreList = 2;
|
|
TypeArtistList = 3;
|
|
TypeReleaseList = 4;
|
|
TypeTrackList = 5;
|
|
TypeCoverArt = 6;
|
|
}
|
|
|
|
|
|
required Type type = 1;
|
|
|
|
optional Revision revision = 2;
|
|
optional GenreList genre_list = 3;
|
|
optional ArtistList artist_list = 4;
|
|
optional ReleaseList release_list = 5;
|
|
optional TrackList track_list = 6;
|
|
repeated CoverArt cover_art = 7;
|
|
}
|
|
|
|
|
|
|
|
|