mirror of
https://github.com/iv-org/invidious.git
synced 2024-06-02 10:37:11 +05:30
don't error when a channel doesn't have any community posts
This commit is contained in:
parent
eda7444ca4
commit
1b6dbaa3eb
|
@ -57,6 +57,17 @@ def extract_channel_community(items, *, ucid, locale, format, thin_mode, is_sing
|
||||||
.try &.as_s || ""
|
.try &.as_s || ""
|
||||||
if error_message == "This channel does not exist."
|
if error_message == "This channel does not exist."
|
||||||
raise NotFoundException.new(error_message)
|
raise NotFoundException.new(error_message)
|
||||||
|
elsif error_message == "This channel hasn't posted yet"
|
||||||
|
response = JSON.build do |json|
|
||||||
|
json.object do
|
||||||
|
json.field "authorId", ucid
|
||||||
|
json.field "comments" do
|
||||||
|
json.array do
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return response
|
||||||
else
|
else
|
||||||
raise InfoException.new(error_message)
|
raise InfoException.new(error_message)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user