Skip to content

Commit 3846f9c

Browse files
authored
Small fix for search topic feat (#713)
1 parent 30bce4d commit 3846f9c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

psst-gui/src/webapi/client.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,10 +1336,10 @@ impl WebApi {
13361336
shows: Option<Page<Arc<Show>>>,
13371337
}
13381338

1339-
let topics = topics.iter().map(SearchTopic::as_str).join(",");
1339+
let type_query_param = topics.iter().map(SearchTopic::as_str).join(",");
13401340
let request = &RequestBuilder::new("v1/search", Method::Get, None)
13411341
.query("q", query.replace(" ", "%20"))
1342-
.query("type", &topics)
1342+
.query("type", &type_query_param)
13431343
.query("limit", limit.to_string())
13441344
.query("marker", "from_token");
13451345

@@ -1350,9 +1350,11 @@ impl WebApi {
13501350
let tracks = result.tracks.map_or_else(Vector::new, |page| page.items);
13511351
let playlists = result.playlists.map_or_else(Vector::new, |page| page.items);
13521352
let shows = result.shows.map_or_else(Vector::new, |page| page.items);
1353+
let topic = (topics.len() == 1).then_some(topics[0]);
13531354

13541355
Ok(SearchResults {
13551356
query: query.into(),
1357+
topic,
13561358
artists,
13571359
albums,
13581360
tracks,

0 commit comments

Comments
 (0)