mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-22 16:19:53 +05:30
Fix issues in Search::Query
This commit is contained in:
parent
25b60a1b90
commit
c7c1b8d4f1
@ -10,7 +10,7 @@ module Invidious::Search
|
|||||||
Playlist # "Add playlist item" search
|
Playlist # "Add playlist item" search
|
||||||
end
|
end
|
||||||
|
|
||||||
@type : Type = Type::Regular
|
getter type : Type = Type::Regular
|
||||||
|
|
||||||
@raw_query : String
|
@raw_query : String
|
||||||
@query : String = ""
|
@query : String = ""
|
||||||
@ -63,14 +63,17 @@ module Invidious::Search
|
|||||||
|
|
||||||
# Specific handling
|
# Specific handling
|
||||||
case @type
|
case @type
|
||||||
when .playlist?, .channel?
|
when .channel?
|
||||||
# In "add playlist item" mode, filters are parsed from the query
|
|
||||||
# string itself (legacy), and the channel is ignored.
|
|
||||||
#
|
|
||||||
# In "channel search" mode, filters are ignored, but we still parse
|
# In "channel search" mode, filters are ignored, but we still parse
|
||||||
# the query prevent transmission of legacy filters to youtube.
|
# 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?
|
when .subscriptions?, .regular?
|
||||||
if params["sp"]?
|
if params["sp"]?
|
||||||
@ -84,7 +87,7 @@ module Invidious::Search
|
|||||||
|
|
||||||
if @filters.default? && @raw_query.includes?(':')
|
if @filters.default? && @raw_query.includes?(':')
|
||||||
# Parse legacy filters from query
|
# 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
|
else
|
||||||
@query = @raw_query || ""
|
@query = @raw_query || ""
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user