This commit is contained in:
Émilien Devos 2022-08-07 20:25:35 +00:00 committed by GitHub
commit 2dd8b32024
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,6 +7,11 @@ module Invidious::Routes::Embed
playlist = get_playlist(plid)
offset = env.params.query["index"]?.try &.to_i? || 0
videos = get_playlist_videos(playlist, offset: offset)
if videos.empty?
url = "/playlist?list=#{plid}"
raise NotFoundException.new("The video requested doesn't exist in the playlist. " \
"Click <a href='#{url}'>here</a> for the playlist home page.")
end
rescue ex : NotFoundException
return error_template(404, ex)
rescue ex
@ -62,6 +67,11 @@ module Invidious::Routes::Embed
playlist = get_playlist(plid)
offset = env.params.query["index"]?.try &.to_i? || 0
videos = get_playlist_videos(playlist, offset: offset)
if videos.empty?
url = "/playlist?list=#{plid}"
raise NotFoundException.new("The video requested doesn't exist in the playlist. " \
"Click <a href='#{url}'>here</a> for the playlist home page.")
end
rescue ex : NotFoundException
return error_template(404, ex)
rescue ex