mirror of
https://github.com/iv-org/invidious.git
synced 2025-04-19 23:25:52 -04:00
update detection of auto_generated channels
This commit is contained in:
parent
df15cf91ff
commit
d61acbed01
@ -139,8 +139,9 @@ def get_about_info(ucid, locale) : AboutChannel
|
||||
# For auto-generated channels, channel_about_meta only has
|
||||
# ["description"]["simpleText"] and ["primaryLinks"][0]["title"]["simpleText"]
|
||||
auto_generated = (
|
||||
(channel_about_meta["primaryLinks"]?.try &.size) == 1 && \
|
||||
extract_text(channel_about_meta.dig?("primaryLinks", 0, "title")) == "Auto-generated by YouTube"
|
||||
((channel_about_meta["primaryLinks"]?.try &.size) == 1 && \
|
||||
extract_text(channel_about_meta.dig?("primaryLinks", 0, "title")) == "Auto-generated by YouTube") ||
|
||||
channel_about_meta.dig?("links", 0, "channelExternalLinkViewModel", "title", "content").try &.as_s == "Auto-generated by YouTube"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
@ -20,21 +20,7 @@ module Invidious::Routes::Channels
|
||||
sort_by = env.params.query["sort_by"]?.try &.downcase
|
||||
|
||||
if channel.auto_generated
|
||||
sort_options = {"last", "oldest", "newest"}
|
||||
|
||||
items, next_continuation = fetch_channel_playlists(
|
||||
channel.ucid, channel.author, continuation, (sort_by || "last")
|
||||
)
|
||||
|
||||
items.uniq! do |item|
|
||||
if item.responds_to?(:title)
|
||||
item.title
|
||||
elsif item.responds_to?(:author)
|
||||
item.author
|
||||
end
|
||||
end
|
||||
items = items.select(SearchPlaylist)
|
||||
items.each(&.author = "")
|
||||
return env.redirect "/channel/#{ucid}/playlists"
|
||||
else
|
||||
sort_options = {"newest", "oldest", "popular"}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user