Fix proto lint issues as much as possible
This commit is contained in:
parent
0af8829987
commit
248c833280
|
|
@ -2,18 +2,6 @@
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "Inflector"
|
|
||||||
version = "0.11.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "aliasable"
|
|
||||||
version = "0.1.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "android_system_properties"
|
name = "android_system_properties"
|
||||||
version = "0.1.5"
|
version = "0.1.5"
|
||||||
|
|
@ -29,12 +17,6 @@ version = "1.0.71"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
|
checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ascii"
|
|
||||||
version = "0.9.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-trait"
|
name = "async-trait"
|
||||||
version = "0.1.68"
|
version = "0.1.68"
|
||||||
|
|
@ -130,12 +112,6 @@ version = "3.12.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b"
|
checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "byteorder"
|
|
||||||
version = "1.4.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bytes"
|
name = "bytes"
|
||||||
version = "1.4.0"
|
version = "1.4.0"
|
||||||
|
|
@ -152,11 +128,10 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
|
||||||
name = "cbd-tui"
|
name = "cbd-tui"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"crabidy-core",
|
||||||
"crossterm",
|
"crossterm",
|
||||||
"cynic",
|
|
||||||
"flume",
|
"flume",
|
||||||
"ratatui",
|
"ratatui",
|
||||||
"reqwest",
|
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -197,19 +172,6 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "combine"
|
|
||||||
version = "3.8.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680"
|
|
||||||
dependencies = [
|
|
||||||
"ascii",
|
|
||||||
"byteorder",
|
|
||||||
"either",
|
|
||||||
"memchr",
|
|
||||||
"unreachable",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "confique"
|
name = "confique"
|
||||||
version = "0.2.3"
|
version = "0.2.3"
|
||||||
|
|
@ -251,15 +213,6 @@ version = "0.8.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
|
checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "counter"
|
|
||||||
version = "0.5.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2d458e66999348f56fd3ffcfbb7f7951542075ca8359687c703de6500c1ddccd"
|
|
||||||
dependencies = [
|
|
||||||
"num-traits",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cpufeatures"
|
name = "cpufeatures"
|
||||||
version = "0.2.7"
|
version = "0.2.7"
|
||||||
|
|
@ -342,83 +295,6 @@ dependencies = [
|
||||||
"typenum",
|
"typenum",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cynic"
|
|
||||||
version = "3.0.0-beta.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2155e722fd76f4fa51635811279242e78cf312de1165e53cec4316425fd97c4d"
|
|
||||||
dependencies = [
|
|
||||||
"cynic-proc-macros",
|
|
||||||
"reqwest",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"static_assertions",
|
|
||||||
"thiserror",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cynic-codegen"
|
|
||||||
version = "3.0.0-beta.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2454afe901e4de5b4cbdf45a18453fff9d6dfe3bb096babd6a62882995a5138c"
|
|
||||||
dependencies = [
|
|
||||||
"counter",
|
|
||||||
"darling",
|
|
||||||
"graphql-parser",
|
|
||||||
"once_cell",
|
|
||||||
"ouroboros",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"strsim",
|
|
||||||
"syn 1.0.109",
|
|
||||||
"thiserror",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cynic-proc-macros"
|
|
||||||
version = "3.0.0-beta.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6fd3ce67a4faeea7002a853acefe43938bc897d593f11abd76039dfb7ec445f0"
|
|
||||||
dependencies = [
|
|
||||||
"cynic-codegen",
|
|
||||||
"syn 1.0.109",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "darling"
|
|
||||||
version = "0.14.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850"
|
|
||||||
dependencies = [
|
|
||||||
"darling_core",
|
|
||||||
"darling_macro",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "darling_core"
|
|
||||||
version = "0.14.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0"
|
|
||||||
dependencies = [
|
|
||||||
"fnv",
|
|
||||||
"ident_case",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"strsim",
|
|
||||||
"syn 1.0.109",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "darling_macro"
|
|
||||||
version = "0.14.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e"
|
|
||||||
dependencies = [
|
|
||||||
"darling_core",
|
|
||||||
"quote",
|
|
||||||
"syn 1.0.109",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "digest"
|
name = "digest"
|
||||||
version = "0.10.7"
|
version = "0.10.7"
|
||||||
|
|
@ -681,16 +557,6 @@ dependencies = [
|
||||||
"system-deps",
|
"system-deps",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "graphql-parser"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474"
|
|
||||||
dependencies = [
|
|
||||||
"combine",
|
|
||||||
"thiserror",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gstreamer"
|
name = "gstreamer"
|
||||||
version = "0.20.5"
|
version = "0.20.5"
|
||||||
|
|
@ -977,12 +843,6 @@ dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ident_case"
|
|
||||||
version = "1.0.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "idna"
|
name = "idna"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
|
@ -1269,29 +1129,6 @@ dependencies = [
|
||||||
"paste",
|
"paste",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ouroboros"
|
|
||||||
version = "0.15.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db"
|
|
||||||
dependencies = [
|
|
||||||
"aliasable",
|
|
||||||
"ouroboros_macro",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ouroboros_macro"
|
|
||||||
version = "0.15.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7"
|
|
||||||
dependencies = [
|
|
||||||
"Inflector",
|
|
||||||
"proc-macro-error",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn 1.0.109",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot"
|
name = "parking_lot"
|
||||||
version = "0.12.1"
|
version = "0.12.1"
|
||||||
|
|
@ -1928,18 +1765,6 @@ dependencies = [
|
||||||
"lock_api",
|
"lock_api",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "static_assertions"
|
|
||||||
version = "1.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "strsim"
|
|
||||||
version = "0.10.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.109"
|
version = "1.0.109"
|
||||||
|
|
@ -2339,15 +2164,6 @@ version = "0.1.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
|
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "unreachable"
|
|
||||||
version = "1.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
|
|
||||||
dependencies = [
|
|
||||||
"void",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unsafe-libyaml"
|
name = "unsafe-libyaml"
|
||||||
version = "0.2.8"
|
version = "0.2.8"
|
||||||
|
|
@ -2389,12 +2205,6 @@ version = "0.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "void"
|
|
||||||
version = "1.0.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "want"
|
name = "want"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,29 @@
|
||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
package crabidy.v1;
|
package crabidy.v1;
|
||||||
|
|
||||||
service LibraryService {
|
service CrabidyService {
|
||||||
|
// Library
|
||||||
rpc GetLibraryNode(GetLibraryNodeRequest) returns (GetLibraryNodeResponse);
|
rpc GetLibraryNode(GetLibraryNodeRequest) returns (GetLibraryNodeResponse);
|
||||||
rpc GetTrack(GetTrackRequest) returns (GetTrackResponse);
|
rpc GetTrack(GetTrackRequest) returns (GetTrackResponse);
|
||||||
|
|
||||||
|
// Queue
|
||||||
|
rpc QueueTrack(QueueTrackRequest) returns (EmptyResponse);
|
||||||
|
rpc QueueLibraryNode(QueueLibraryNodeRequest) returns (EmptyResponse);
|
||||||
|
rpc ReplaceWithTrack(ReplaceWithTrackRequest) returns (EmptyResponse);
|
||||||
|
rpc ReplaceWithNode(ReplaceWithNodeRequest) returns (EmptyResponse);
|
||||||
|
rpc AppendTrack(AppendTrackRequest) returns (EmptyResponse);
|
||||||
|
rpc AppendNode(AppendNodeRequest) returns (EmptyResponse);
|
||||||
|
rpc RemoveTracks(RemoveTracksRequest) returns (EmptyResponse);
|
||||||
|
rpc SetCurrentTrack(SetCurrentTrackRequest) returns (EmptyResponse);
|
||||||
|
rpc GetQueueUpdates(GetQueueUpdatesRequest) returns (stream GetQueueUpdatesResponse);
|
||||||
|
rpc GetQueue(EmptyRequest) returns (GetQueueResponse);
|
||||||
|
rpc SaveQueue(SaveQueueRequest) returns (EmptyResponse);
|
||||||
|
|
||||||
|
// Playback
|
||||||
|
rpc TogglePlay(EmptyRequest) returns (EmptyResponse);
|
||||||
|
rpc Stop(EmptyRequest) returns (EmptyResponse);
|
||||||
|
rpc GetActiveTrack(EmptyRequest) returns (GetActiveTrackResponse);
|
||||||
|
rpc GetTrackUpdates(GetTrackUpdatesRequest) returns (stream GetTrackUpdatesResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// To signal whether it's loading data (for frontend only probably -
|
// To signal whether it's loading data (for frontend only probably -
|
||||||
|
|
@ -58,22 +78,8 @@ message GetTrackResponse {
|
||||||
Track track = 1;
|
Track track = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
service Queue {
|
message Queue {
|
||||||
rpc QueueTrack (QueueTrackRequest) returns (EmptyResponse);
|
uint64 timestamp = 1;
|
||||||
rpc QueueLibraryNode (QueueNodeRequest) returns (EmptyResponse);
|
|
||||||
rpc ReplaceWithTrack (QueueTrackRequest) returns (EmptyResponse);
|
|
||||||
rpc ReplaceWithNode (QueueNodeRequest) returns (EmptyResponse);
|
|
||||||
rpc AppendTrack (QueueTrackRequest) returns (EmptyResponse);
|
|
||||||
rpc AppendNode (QueueNodeRequest) returns (EmptyResponse);
|
|
||||||
rpc RemoveTracks (RemoveTracksRequest) returns (EmptyResponse);
|
|
||||||
rpc SetCurrentTrack (SetCurrentTrackRequest) returns (EmptyResponse);
|
|
||||||
rpc GetQueueUpdates (QueueUpdatesRequest) returns (stream QueueUpdateResponse);
|
|
||||||
rpc GetQueue(EmptyRequest) returns (CurrentQueue);
|
|
||||||
rpc SaveQueue (QueueSaveRequest) returns (EmptyResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
message CurrentQueue {
|
|
||||||
uint64 timestamp =1;
|
|
||||||
uint32 current = 2;
|
uint32 current = 2;
|
||||||
repeated Track tracks = 3;
|
repeated Track tracks = 3;
|
||||||
}
|
}
|
||||||
|
|
@ -87,7 +93,23 @@ message QueueTrackRequest {
|
||||||
string uuid = 1;
|
string uuid = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message QueueNodeRequest {
|
message ReplaceWithTrackRequest {
|
||||||
|
string uuid = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AppendTrackRequest {
|
||||||
|
string uuid = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message QueueLibraryNodeRequest {
|
||||||
|
string uuid = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ReplaceWithNodeRequest {
|
||||||
|
string uuid = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AppendNodeRequest {
|
||||||
string uuid = 1;
|
string uuid = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,41 +121,36 @@ message SetCurrentTrackRequest {
|
||||||
uint32 position = 1;
|
uint32 position = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message GetQueueUpdatesRequest {
|
||||||
message QueueUpdatesRequest {
|
uint64 timestamp = 2;
|
||||||
uint64 timestamp =2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message QueueUpdateResponse {
|
message GetQueueResponse {
|
||||||
oneof QueueUpdateResult{
|
Queue queue = 1;
|
||||||
CurrentQueue full = 1;
|
}
|
||||||
|
|
||||||
|
message GetQueueUpdatesResponse {
|
||||||
|
oneof queue_update_result {
|
||||||
|
Queue full = 1;
|
||||||
QueuePositionChange position_change = 2;
|
QueuePositionChange position_change = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message QueueSaveRequest {
|
message SaveQueueRequest {
|
||||||
string name = 1;
|
string name = 1;
|
||||||
// inside the configured path of crabidy
|
// inside the configured path of crabidy
|
||||||
string path = 2;
|
string path = 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
service Playback {
|
|
||||||
rpc TogglePlay (EmptyRequest) returns (EmptyResponse);
|
|
||||||
rpc Stop (EmptyRequest) returns (EmptyResponse);
|
|
||||||
rpc GetActiveTrack (EmptyRequest) returns (ActiveTrack);
|
|
||||||
rpc GetTrackUpdates (ActiveTrackFilter) returns (stream ActiveTrack);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
enum TrackPlayState {
|
enum TrackPlayState {
|
||||||
TRACK_PLAY_STATE_STOPPED = 0;
|
TRACK_PLAY_STATE_UNSPECIFIED = 0;
|
||||||
TRACK_PLAY_STATE_LOADING = 1;
|
TRACK_PLAY_STATE_STOPPED = 1;
|
||||||
TRACK_PLAY_STATE_PLAYING = 2;
|
TRACK_PLAY_STATE_LOADING = 2;
|
||||||
TRACK_PLAY_STATE_PAUSED = 3;
|
TRACK_PLAY_STATE_PLAYING = 3;
|
||||||
|
TRACK_PLAY_STATE_PAUSED = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ActiveTrackFilter {
|
message GetTrackUpdatesRequest {
|
||||||
// defines how many of the update messages should be skipped
|
// defines how many of the update messages should be skipped
|
||||||
// before they are sent back via GetTrackUpdates
|
// before they are sent back via GetTrackUpdates
|
||||||
uint32 updates_skipped = 1;
|
uint32 updates_skipped = 1;
|
||||||
|
|
@ -141,11 +158,17 @@ message ActiveTrackFilter {
|
||||||
repeated string type_blacklist = 3;
|
repeated string type_blacklist = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ActiveTrack {
|
message GetActiveTrackResponse {
|
||||||
optional Track track = 1;
|
optional Track track = 1;
|
||||||
TrackPlayState play_state = 2;
|
TrackPlayState play_state = 2;
|
||||||
uint32 completion = 3;
|
uint32 completion = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message EmptyRequest { }
|
message GetTrackUpdatesResponse {
|
||||||
message EmptyResponse { }
|
optional Track track = 1;
|
||||||
|
TrackPlayState play_state = 2;
|
||||||
|
uint32 completion = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message EmptyRequest {}
|
||||||
|
message EmptyResponse {}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
pub mod proto;
|
pub mod proto;
|
||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
|
use proto::crabidy::{LibraryNode, LibraryNodeState};
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait ProviderClient: std::fmt::Debug + Send + Sync {
|
pub trait ProviderClient: std::fmt::Debug + Send + Sync {
|
||||||
|
|
@ -9,11 +10,8 @@ pub trait ProviderClient: std::fmt::Debug + Send + Sync {
|
||||||
Self: Sized;
|
Self: Sized;
|
||||||
fn settings(&self) -> String;
|
fn settings(&self) -> String;
|
||||||
async fn get_urls_for_track(&self, track_uuid: &str) -> Result<Vec<String>, ProviderError>;
|
async fn get_urls_for_track(&self, track_uuid: &str) -> Result<Vec<String>, ProviderError>;
|
||||||
fn get_library_root(&self) -> proto::crabidy::LibraryNode;
|
fn get_library_root(&self) -> LibraryNode;
|
||||||
async fn get_library_node(
|
async fn get_library_node(&self, list_uuid: &str) -> Result<LibraryNode, ProviderError>;
|
||||||
&self,
|
|
||||||
list_uuid: &str,
|
|
||||||
) -> Result<proto::crabidy::LibraryNode, ProviderError>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Hash)]
|
#[derive(Clone, Debug, Hash)]
|
||||||
|
|
@ -25,14 +23,14 @@ pub enum ProviderError {
|
||||||
Other,
|
Other,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl proto::crabidy::LibraryNode {
|
impl LibraryNode {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
uuid: "/".to_string(),
|
uuid: "/".to_string(),
|
||||||
name: "/".to_string(),
|
name: "/".to_string(),
|
||||||
children: Vec::new(),
|
children: Vec::new(),
|
||||||
parent: None,
|
parent: None,
|
||||||
state: proto::crabidy::LibraryNodeState::Unspecified as i32,
|
state: LibraryNodeState::Unspecified as i32,
|
||||||
tracks: Vec::new(),
|
tracks: Vec::new(),
|
||||||
is_queable: false,
|
is_queable: false,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue