Skip to content

Commit

Permalink
rewrite "" search queries as ``
Browse files Browse the repository at this point in the history
closes #229
  • Loading branch information
sentriz committed Jul 21, 2022
1 parent a9d3933 commit 4557a4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/ctrlsubsonic/handlers_by_folder.go
Expand Up @@ -177,6 +177,9 @@ func (c *Controller) ServeSearchTwo(r *http.Request) *spec.Response {
if err != nil {
return spec.NewError(10, "please provide a `query` parameter")
}
if query == `""` {
query = ""
}
query = fmt.Sprintf("%%%s%%", strings.TrimSuffix(query, "*"))

results := &spec.SearchResultTwo{}
Expand Down
3 changes: 3 additions & 0 deletions server/ctrlsubsonic/handlers_by_tags.go
Expand Up @@ -182,6 +182,9 @@ func (c *Controller) ServeSearchThree(r *http.Request) *spec.Response {
if err != nil {
return spec.NewError(10, "please provide a `query` parameter")
}
if query == `""` {
query = ""
}
query = fmt.Sprintf("%%%s%%", strings.TrimSuffix(query, "*"))
results := &spec.SearchResultThree{}

Expand Down

0 comments on commit 4557a4e

Please sign in to comment.