diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2022-04-16 20:25:25 +0200 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2022-04-16 20:25:25 +0200 |
| commit | c7c1b8d4f1c5b314f75341f54fd0e9cd6e54c96b (patch) | |
| tree | 484bdc19a7edefa631da0dd4f3fd6c7f8451b7c5 | |
| parent | 25b60a1b900a1c62dbcf4e62484d472dacd373ee (diff) | |
| download | invidious-c7c1b8d4f1c5b314f75341f54fd0e9cd6e54c96b.tar.gz invidious-c7c1b8d4f1c5b314f75341f54fd0e9cd6e54c96b.tar.bz2 invidious-c7c1b8d4f1c5b314f75341f54fd0e9cd6e54c96b.zip | |
Fix issues in Search::Query
| -rw-r--r-- | src/invidious/search/query.cr | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/invidious/search/query.cr b/src/invidious/search/query.cr index 1c2b37d2..34b36b1d 100644 --- a/src/invidious/search/query.cr +++ b/src/invidious/search/query.cr @@ -10,7 +10,7 @@ module Invidious::Search Playlist # "Add playlist item" search end - @type : Type = Type::Regular + getter type : Type = Type::Regular @raw_query : String @query : String = "" @@ -63,14 +63,17 @@ module Invidious::Search # Specific handling case @type - when .playlist?, .channel? - # In "add playlist item" mode, filters are parsed from the query - # string itself (legacy), and the channel is ignored. - # + when .channel? # In "channel search" mode, filters are ignored, but we still parse # the query prevent transmission of legacy filters to youtube. # - @filters, @query, @channel, _ = Filters.from_legacy_filters(@raw_query || "") + _, _, @query, _ = Filters.from_legacy_filters(@raw_query) + # + when .playlist? + # In "add playlist item" mode, filters are parsed from the query + # string itself (legacy), and the channel is ignored. + # + @filters, _, @query, _ = Filters.from_legacy_filters(@raw_query) # when .subscriptions?, .regular? if params["sp"]? @@ -84,7 +87,7 @@ module Invidious::Search if @filters.default? && @raw_query.includes?(':') # Parse legacy filters from query - @filters, @query, @channel, subs = Filters.from_legacy_filters(@raw_query || "") + @filters, @channel, @query, subs = Filters.from_legacy_filters(@raw_query) else @query = @raw_query || "" end |
