Skip to content

Commit 24f5656

Browse files
authored
Merge pull request #23 from tsirysndr/new-api
feat(api): call a generic radio provider
2 parents f1a947f + 9380a5d commit 24f5656

File tree

12 files changed

+880
-429
lines changed

12 files changed

+880
-429
lines changed

Cargo.lock

Lines changed: 312 additions & 151 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ m3u = "1.0.0"
3636
minimp3 = "0.5.1"
3737
owo-colors = "3.5.0"
3838
pls = "0.2.2"
39-
prost = "0.11.8"
39+
prost = "0.13.2"
4040
radiobrowser = { version = "0.6.1", features = ["default-rustls"], default-features = false }
4141
ratatui = "0.26.1"
4242
regex = "1.11.1"
@@ -48,11 +48,12 @@ surf = {version = "2.3.2", features = ["h1-client-rustls"], default-features = f
4848
symphonia = {version = "0.5.1", features = ["aac", "alac", "mp3", "isomp4", "flac"]}
4949
termion = "2.0.1"
5050
thiserror = "1.0.58"
51-
tokio = {version = "1.24.2", features = ["tokio-macros", "macros", "rt", "rt-multi-thread"]}
52-
tonic = "0.8.3"
53-
tonic-web = "0.4.0"
51+
tokio = {version = "1.36.0", features = ["tokio-macros", "macros", "rt", "rt-multi-thread"]}
52+
tonic = "0.12.3"
53+
tonic-reflection = "0.12.3"
54+
tonic-web = "0.12.3"
5455
tunein = "0.1.3"
5556
url = "2.3.1"
5657

5758
[build-dependencies]
58-
tonic-build = "0.8"
59+
tonic-build = "0.12.3"

build.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
fn main() -> Result<(), Box<dyn std::error::Error>> {
2-
tonic_build::configure().out_dir("src/api").compile(
3-
&[
4-
"proto/objects/v1alpha1/category.proto",
5-
"proto/objects/v1alpha1/station.proto",
6-
"proto/tunein/v1alpha1/browse.proto",
7-
"proto/tunein/v1alpha1/playback.proto",
8-
],
9-
&["proto"],
10-
)?;
2+
tonic_build::configure()
3+
.out_dir("src/api")
4+
.file_descriptor_set_path("src/api/descriptor.bin")
5+
.compile_protos(
6+
&[
7+
"proto/objects/v1alpha1/category.proto",
8+
"proto/objects/v1alpha1/station.proto",
9+
"proto/tunein/v1alpha1/browse.proto",
10+
"proto/tunein/v1alpha1/playback.proto",
11+
],
12+
&["proto"],
13+
)?;
1114
Ok(())
1215
}

proto/tunein/v1alpha1/browse.proto

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,20 @@ message GetStationDetailsRequest {
2424
}
2525

2626
message GetStationDetailsResponse {
27-
repeated objects.v1alpha1.StationLinkDetails station_link_details = 1;
27+
objects.v1alpha1.StationLinkDetails station_link_details = 1;
28+
}
29+
30+
message SearchRequest {
31+
string query = 1;
32+
}
33+
34+
message SearchResponse {
35+
repeated objects.v1alpha1.Station station = 1;
2836
}
2937

3038
service BrowseService {
3139
rpc GetCategories(GetCategoriesRequest) returns (GetCategoriesResponse) {}
3240
rpc BrowseCategory(BrowseCategoryRequest) returns (BrowseCategoryResponse) {}
3341
rpc GetStationDetails(GetStationDetailsRequest) returns (GetStationDetailsResponse) {}
42+
rpc Search(SearchRequest) returns (SearchResponse) {}
3443
}

src/api/descriptor.bin

4.74 KB
Binary file not shown.

src/api/objects.v1alpha1.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[allow(clippy::derive_partial_eq_without_eq)]
1+
// This file is @generated by prost-build.
22
#[derive(Clone, PartialEq, ::prost::Message)]
33
pub struct Station {
44
#[prost(string, tag = "1")]
@@ -8,7 +8,6 @@ pub struct Station {
88
#[prost(string, tag = "3")]
99
pub playing: ::prost::alloc::string::String,
1010
}
11-
#[allow(clippy::derive_partial_eq_without_eq)]
1211
#[derive(Clone, PartialEq, ::prost::Message)]
1312
pub struct StationLinkDetails {
1413
#[prost(uint32, tag = "1")]
@@ -38,7 +37,6 @@ pub struct StationLinkDetails {
3837
#[prost(string, tag = "13")]
3938
pub url: ::prost::alloc::string::String,
4039
}
41-
#[allow(clippy::derive_partial_eq_without_eq)]
4240
#[derive(Clone, PartialEq, ::prost::Message)]
4341
pub struct Category {
4442
#[prost(string, tag = "1")]

0 commit comments

Comments
 (0)